Main Content

readCRS

Read coordinate reference system data from LAS or LAZ file

Since R2022a

Description

example

crs = readCRS(lasReader) reads the coordinate reference system data from the LAS or LAZ file indicated by the input lasFileReader object lasReader.

This function requires the Mapping Toolbox™.

Examples

collapse all

Create a lasFileReader object for a LAZ file. Then, use the readCRS function to read coordinate reference system (CRS) data from the LAZ file and generate a projcrs object.

Create a lasFileReader object to access the LAZ file data.

path = fullfile(toolboxdir("lidar"),"lidardata", ...
    "las","aerialLidarData.laz");
lasReader = lasFileReader(path);

Check if the LAZ file contains CRS data using the hasCRSData function. If it does, read the CRS data from the LAZ file using the readCRS function.

if hasCRSData(lasReader)
    crs = readCRS(lasReader);
    disp(crs);
else
    disp("No CRS data available.");
end
  projcrs with properties:

                    Name: "NAD83 / UTM zone 16N"
           GeographicCRS: [1x1 geocrs]
        ProjectionMethod: "Transverse Mercator"
              LengthUnit: "meter"
    ProjectionParameters: [1x1 map.crs.ProjectionParameters]

Input Arguments

collapse all

LAS or LAZ file reader, specified as a lasFileReader object.

Output Arguments

collapse all

Coordinate reference system (CRS), returned as one of these objects:

  • geocrs (Mapping Toolbox) — Returned by a file that contains geographic CRS data.

  • projcrs (Mapping Toolbox) — Returned by a file that contains projected CRS data.

Version History

Introduced in R2022a