Click or drag to resize
Cartography Class
A cartography object handles a map projection and a local grid that can be translated and rotated relative to the projected coordinate system.

There are 3 levels of coordinates: Geographical coordinates (longitude, latitude) in degrees, projection coordinates (easting, northing), and local/model/user grid coordinates (x,y).

The ProjectionString defines the mapping from geographical coordinates to projection coordinates.

The LatOrigin, LonOrigin and Orientation defines the origin and the orientation of the local grid coordinates. It defines how the local grid coordinate system is translated and rotated. This kind of local grid coordinate system is used for e.g. a 2D grid in a dfs2 file.

See Orientation for the definition of the orientation. The local grid are rotated around its origin.

If LonOrigin is zero, and LatOrigin and ProjectionOrigin(String, Double, Double) matches the origin of the projection coordinate system (from MapProjection), then projection coordinates equals local grid coordinates. Example: UTM-31 has projection origin at (lon,lat) = (3,0).

Inheritance Hierarchy
SystemObject
  DHI.ProjectionsCartography

Namespace: DHI.Projections
Assembly: DHI.Projections (in DHI.Projections.dll) Version: 16.0.0.0 (11.1.1.1111)
Syntax
public class Cartography

The Cartography type exposes the following members.

Constructors
  NameDescription
Public methodCartography(String, Boolean)
Create and initialize a Cartography object using the specified projection string.
Public methodCartography(String, Double, Double, Boolean)
Create and initialize a cartography object using the specified projection string, setting the origin of the user defined local grid coordinates to the lonOrigin, latOrigin
Public methodCartography(String, Double, Double, Double, Boolean)
Create and initialize a cartography object using the specified projection string, setting the origin of the user defined local grid coordinates to the lonOrigin, latOrigin, rotated orientation.
Top
Properties
  NameDescription
Public propertyEastOrigin
Get the origin easting coordinate of the local grid coordinate system.

For geographical map projections ((lon,lat) coordinates), this has no meaning (has the same value as the LonOrigin)

Public propertyLatOrigin
Get the origin latitude coordinate of the local grid coordinate system.
Public propertyLonOrigin
Get the origin longitude coordinate of the local grid coordinate system.
Public propertyNorthOrigin
Get the origin northing coordinate of the local grid coordinate system.

For geographical map projections ((lon,lat) coordinates), this has no meaning (has the same value as the LatOrigin)

Public propertyOrientation
Get the orientation of the local grid coordinate system in the geographical coordinate system.

The orientation is the angle in degrees between true north and the coordinate system y-axis in degrees, measured positive clockwise from true north.

Public propertyOrientationProj
Get the orientation of the local grid coordinate system in the projected coordinate system.

The orientation is the angle in degrees between projection north and the coordinate system y-axis in degrees, measured positive clockwise from projection north.

For geographical map projections ((lon,lat) coordinates), this has no meaning (has the same value as the Orientation)

Public propertyProjection
Get the map projection that this cartography object uses.
Public propertyProjectionName
The short name of a projection.

The short name is not unique amongst all WKT projections

If the ProjectionString is not a WKT projection string, the ProjectionString itself is returned as the short name.

Public propertyProjectionNorth Obsolete.
Returns the angle between projection north and a line parallel to the local grid.

This is NOT the same as the Orientation, the orientation is towards true north, this is towards projection north.

Public propertyProjectionString
Returns the WKT projection string, or one of the projection abbreviation strings.
Top
Methods
  NameDescription
Public methodStatic memberCreateGeoOrigin
Create and initialize a cartography object using the specified projection string, setting the origin of the user defined local grid coordinates to the geographic coordinates lonOrigin, latOrigin, rotated orientation.
Public methodStatic memberCreateProjOrigin
Create and initialize a cartography object using the specified projection string, setting the origin of the user defined local grid coordinates to the projected coordinates east, north, rotated orientationProj towards projection north.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGeo2Proj
Convert coordinates from geographical coordinates to projection coordinates
Public methodGeo2Xy
Convert coordinates from geographical coordinates to local grid x-y coordinates
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetTrueNorth
Returns the angle between true north and a line parallel to the local grid y axis passing through (x,y).

The angle is in degrees, measured positive clockwise from true north.

Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodProj2Geo
Convert coordinates from projection coordinates to geographical coordinates
Public methodProj2Xy
Convert coordinates from projetion coordinates to local grid x-y coordinates
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodXy2Geo
Convert coordinates from local grid x-y coordinates to geographical coordinates
Public methodXy2Proj
Convert coordinates from local grid x-y coordinates to projection coordinates
Top
Examples
// The abbreviation for the long WKT projection string
utm33String = "UTM-33"; 

// Create a Cartography object with a local grid origin at lon-lat (17,55)
// rotated -45 degrees from true north.
Cartography cart = new Cartography(utm33String, 17, 55, -45);
double east, north, x, y;

// Convert from geographical to map projection coordinates
cart.Geo2Proj(17, 55, out east, out north);

// Convert from geographical to local grid coordinates
cart.Geo2Xy(17, 55, out x, out y);
See Also