Main Content

projcrs

Projected coordinate reference system object

Since R2020b

Description

A projected coordinate reference system (CRS) provides information that assigns Cartesian x and y map coordinates to physical locations. Projected CRSs consist of a geographic CRS and several parameters that are used to transform coordinates to and from the geographic CRS. For more information about geographic CRSs, see geocrs.

Creation

You can create a projected CRS object in several ways:

  • Import raster data by using readgeoraster, and then query the ProjectedCRS property of the returned raster reference object.

  • Import vector data by using the readgeotable function, and then query the ProjectedCRS property of the shape objects in the returned geospatial table.

  • Get information about a shapefile by using the shapeinfo function, and then query the CoordinateReferenceSystem field of the returned structure.

  • Use the projcrs function (described here).

Description

example

p = projcrs(code) creates a projected CRS object using the EPSG code specified by code.

example

p = projcrs(code,"Authority",authority) creates a projected CRS object using the specified code and authority.

example

p = projcrs(wkt) creates a projected CRS object using the well-known text (WKT) string representation specified by wkt.

Input Arguments

expand all

Projected CRS code, specified as a positive integer, string scalar, or character vector. By default, the projcrs function assumes the code argument is an EPSG code. To specify other types of codes, use the Authority name-value argument.

To refer to an EPSG or ESRI code, specify this argument as a positive integer. To refer to an IGNF code, specify this argument as a string scalar or character vector.

For information on valid EPSG codes, see the EPSG home page.

Organization that manages the definition of the CRS, specified as "EPSG", "ESRI", or "IGNF". Each organization maintains a list of codes associated with specific CRSs.

If you do not specify an authority, then the projcrs function uses "EPSG".

Well-known text (WKT), specified as a string scalar or character vector. You can specify WKT using either the WKT 1 or WKT 2 standard.

The parameters listed in the ProjectionParameters property use the WKT 2 standard, even if you specify text that uses the WKT 1 standard.

Properties

expand all

CRS name, specified as a string scalar.

Changing the value of a projection parameter stored in the ProjectionParameters property can automatically change the value of this property to "". If you manually change the value of the Name property, then changing a projection parameter does not automatically change this property.

Data Types: string

This property is read-only.

Geographic CRS, returned as a geocrs object. A geographic CRS consists of a datum (including its ellipsoid), prime meridian, and angular unit of measurement.

This property is read-only.

Length unit, returned as a string scalar. Possible values include "meter" and "U.S. survey foot".

Data Types: string

This property is read-only.

Projection method, returned as a string scalar. Possible values include "Lambert Conic Conformal (2SP)" and "Transverse Mercator".

Data Types: string

Projection parameters, specified as a ProjectionParameters object. The parameters in a ProjectionParameters object use the WKT 2 standard, even if the supplied wkt argument uses the WKT 1 standard.

You can access and change individual projection parameters using dot notation. For example, create a projcrs object and access the LatitudeOfFalseOrigin parameter.

p = projcrs(26986);
p.ProjectionParameters.LatitudeOfFalseOrigin

This table describes common projection parameters, including those used by the Lambert Conformal Conic and Transverse Mercator projection methods. Other projection methods might use different parameters than those listed. Other projection methods might have ranges for valid values that are narrower than those listed.

ParameterDescription
EastingAtFalseOrigin

Easting at the false origin, specified as a number in the units specified by LengthUnit. A projected CRS often uses a false origin such that all coordinates within the CRS have positive values. The easting at the false origin is with respect to the grid origin at (0, 0).

FalseEasting

False easting, specified as a number in the units specified by LengthUnit. A projected CRS often uses a false easting to shift the y-axis of the map grid so that the x-coordinates have positive values.

FalseNorthing

False northing, specified as a number in the units specified by LengthUnit. A projected CRS often uses a false northing to shift the x-axis of the map grid so that the y-coordinates have positive values.

LatitudeOf1stStandardParallel

Latitude of the first standard parallel, in degrees, specified as a number in the range [–90, 90]. Standard parallels are the parallels at which the cone or cylinder used in a conic or cylindrical projection intersects the reference spheroid.

LatitudeOf2ndStandardParallel

Latitude of the second standard parallel, in degrees, specified as a number in the range [–90, 90]. Standard parallels are the parallels at which the cone or cylinder used in a conic or cylindrical projection intersects the reference spheroid.

LatitudeOfFalseOrigin

Latitude of false origin, in degrees, specified as a number in the range [–90, 90]. A projected CRS typically uses a false origin such that all coordinates within the CRS have positive values.

LatitudeOfNaturalOrigin

Latitude of the natural origin, in degrees, specified as a number in the range [–90, 90]. The natural origin is the grid origin without the shift by a false northing or easting.

LongitudeOfFalseOrigin

Longitude of false origin, in degrees, specified as a number in the range [–180, 180]. A projected CRS typically uses a false origin such that all coordinates within the CRS have positive values.

LongitudeOfNaturalOrigin

Longitude of the natural origin, in degrees, specified as a number in the range [–180, 180]. The natural origin is the grid origin without the shift by a false northing or easting.

NorthingAtFalseOrigin

Northing at the false origin, specified as a number in the units specified by LengthUnit. A projected CRS typically uses a false origin such that all coordinates within the CRS have positive values. The northing at the false origin is with respect to the grid origin at (0, 0).

ScaleFactorAtNaturalOrigin

Scale factor at the natural origin, specified as a number with no units in the range [0.9, 1.1]. The natural origin is the grid origin without the shift by a false northing or easting. A projected CRS typically uses a scale factor (a number close to 1) to balance scale distortion across the area covered by the coordinate system.

When you change the value of a projection parameter, the projcrs object removes the name, area of use, and authority from the WKT associated with the object. As a result, changing the value of a projection parameter can automatically change the value of the Name property to "".

Object Functions

projfwdProject latitude-longitude coordinates to x-y map coordinates
projinvUnproject x-y map coordinates to latitude-longitude coordinates
wktstringWell-known text string
isequalCompare two projcrs or geocrs objects for equivalence

Examples

collapse all

Create a projected CRS object by specifying an EPSG code.

p = projcrs(5325)
p = 
  projcrs with properties:

                    Name: "ISN2004 / Lambert 2004"
           GeographicCRS: [1x1 geocrs]
        ProjectionMethod: "Lambert Conic Conformal (2SP)"
              LengthUnit: "meter"
    ProjectionParameters: [1x1 map.crs.ProjectionParameters]

Create a projected CRS object from an ESRI code by using the Authority name-value argument.

p = projcrs(53026,"Authority","ESRI")
p = 
  projcrs with properties:

                    Name: "Sphere_Stereographic"
           GeographicCRS: [1x1 geocrs]
        ProjectionMethod: "Stereographic"
              LengthUnit: "meter"
    ProjectionParameters: [1x1 map.crs.ProjectionParameters]

Create a projected CRS object from an IGNF code by using the Authority name-value argument. Specify the code using a string scalar or character vector.

p = projcrs("UTM39SW84","Authority","IGNF")
p = 
  projcrs with properties:

                    Name: "WGS84 UTM SUD FUSEAU 39"
           GeographicCRS: [1x1 geocrs]
        ProjectionMethod: "Transverse Mercator"
              LengthUnit: "meter"
    ProjectionParameters: [1x1 map.crs.ProjectionParameters]

Import a WKT projection file as a character vector by using the fileread function. Then create a projected CRS object by specifying the vector.

wkt = fileread('MtWashington-ft.prj');
p = projcrs(wkt)
p = 
  projcrs with properties:

                    Name: "UTM Zone 19, Northern Hemisphere"
           GeographicCRS: [1x1 geocrs]
        ProjectionMethod: "Transverse Mercator"
              LengthUnit: "meter"
    ProjectionParameters: [1x1 map.crs.ProjectionParameters]

Import raster data as an array and a map reference object using the readgeoraster function. Then, get the projected CRS by querying the ProjectedCRS property of the reference object.

[Z,R] = readgeoraster('boston.tif');
R.ProjectedCRS
ans = 
  projcrs with properties:

                    Name: "NAD83 / Massachusetts Mainland"
           GeographicCRS: [1×1 geocrs]
        ProjectionMethod: "Lambert Conic Conformal (2SP)"
              LengthUnit: "U.S. survey foot"
    ProjectionParameters: [1×1 map.crs.ProjectionParameters]

Alternatively, return information about the same file as a RasterInfo object using the georasterinfo function. Then, get the projected CRS by querying the CoordinateReferenceSystem property of the object.

info = georasterinfo('boston.tif');
info.CoordinateReferenceSystem
ans = 
  projcrs with properties:

                    Name: "NAD83 / Massachusetts Mainland"
           GeographicCRS: [1×1 geocrs]
        ProjectionMethod: "Lambert Conic Conformal (2SP)"
              LengthUnit: "U.S. survey foot"
    ProjectionParameters: [1×1 map.crs.ProjectionParameters]

Get the projection parameters for a projected CRS by creating a projcrs object and querying its ProjectionParameters property.

p = projcrs(32644);
parameters = p.ProjectionParameters
parameters = 
  ProjectionParameters object with parameters:

       LatitudeOfNaturalOrigin: 0
      LongitudeOfNaturalOrigin: 81
    ScaleFactorAtNaturalOrigin: 0.9996
                  FalseEasting: 500000
                 FalseNorthing: 0

Query an individual projection parameter by using dot notation.

p.ProjectionParameters.ScaleFactorAtNaturalOrigin
ans = 0.9996

Change the value of a projection parameter by using dot notation (since R2023a).

p.ProjectionParameters.LongitudeOfNaturalOrigin = 87;

Tips

When you compare two ProjectionParameters objects by using the isequal function, the function might return 0 (false), even when the parameter values are the same. Instead, compare ProjectionParameters objects by comparing the projcrs objects or by comparing the parameter values directly.

Version History

Introduced in R2020b

expand all