ArcGISCoordinateFormatter

Namespace: GameEngine.Geometry
Class: GameEngine/Geometry/ArcGISCoordinateFormatter
Since: 1.0.0

Summary

Converts between Points and formatted coordinate notation strings such as decimal degrees; degrees, minutes, and seconds; U.S. National Grid (USNG); and Military Grid Reference System (MGRS).

Methods

SignatureReturn TypeSummary

FromGARS(string, ArcGISSpatialReference, ArcGISGARSConversionMode)

ArcGISPoint

Parses a coordinate in Global Area Reference System (GARS) notation, and returns a Point representing that location.

FromGeoRef(string, ArcGISSpatialReference)

ArcGISPoint

Parses a coordinate in World Geographic Reference System (GEOREF) notation, and returns a Point representing that location.

FromLatitudeLongitude(string, ArcGISSpatialReference)

ArcGISPoint

Parses a coordinate in latitude-longitude notation, and returns a Point representing that location. The coordinate may use decimal degrees, degrees and decimal minutes, or degrees, minutes, and seconds format.

FromMGRS(string, ArcGISSpatialReference, ArcGISMGRSConversionMode)

ArcGISPoint

Parses a coordinate in Military Grid Reference System (MGRS) notation, and returns a Point representing that location.

FromUSNG(string, ArcGISSpatialReference)

ArcGISPoint

Parses a coordinate in United States National Grid (USNG) notation, and returns a Point representing that location.

FromUTM(string, ArcGISSpatialReference, ArcGISUTMConversionMode)

ArcGISPoint

Parses a coordinate in Universal Transverse Mercator (UTM) notation, and returns a Point representing that location.

ToGARS(ArcGISPoint)

string

Returns a formatted coordinate in Global Area Reference System (GARS) notation representing the given point's location.

ToGeoRef(ArcGISPoint, int)

string

Returns a formatted coordinate in World Geographic Reference System (GEOREF) notation representing the given point's location.

ToLatitudeLongitude(ArcGISPoint, ArcGISLatitudeLongitudeFormat, int)

string

Returns a formatted coordinate in latitude-longitude notation representing the given point's location.

ToMGRS(ArcGISPoint, ArcGISMGRSConversionMode, int, bool)

string

Returns a formatted coordinate in Military Grid Reference System (MGRS) notation representing the given point's location.

ToUSNG(ArcGISPoint, int, bool)

string

Returns a formatted coordinate in United States National Grid (USNG) notation representing the given point's location.

ToUTM(ArcGISPoint, ArcGISUTMConversionMode, bool)

string

Returns a formatted coordinate in Universal Transverse Mercator (UTM) notation representing the given point's location.

FromGARS

static ArcGISPoint FromGARS(string coordinates, ArcGISSpatialReference spatialReference, ArcGISGARSConversionMode GARSConversionMode)

Parses a coordinate in Global Area Reference System (GARS) notation, and returns a Point representing that location.

Since 1.0.0

Arguments
NameTypeSummary
coordinates

The GARS notation string for the coordinate.

spatialReference

A spatial reference that defines the datum and ellipsoid referenced by the GARS coordinate.

GARSConversionMode

Select whether the returned point's location represents the south-west corner of the GARS cell the coordinate lies within, or its center.

Returns ArcGISPoint

A point with the location from the GARS string in the spatial reference provided.

FromGeoRef

static ArcGISPoint FromGeoRef(string coordinates, ArcGISSpatialReference spatialReference)

Parses a coordinate in World Geographic Reference System (GEOREF) notation, and returns a Point representing that location.

Since 1.0.0

Arguments
NameTypeSummary
coordinates

The GEOREF notation string for the coordinate.

spatialReference

A spatial reference that defines the datum and ellipsoid referenced by the GEOREF coordinate.

Returns ArcGISPoint

A point with the location from the GEOREF string in the spatial reference provided.

FromLatitudeLongitude

static ArcGISPoint FromLatitudeLongitude(string coordinates, ArcGISSpatialReference spatialReference)

Parses a coordinate in latitude-longitude notation, and returns a Point representing that location. The coordinate may use decimal degrees, degrees and decimal minutes, or degrees, minutes, and seconds format.

Since 1.0.0

Arguments
NameTypeSummary
coordinates

The latitude-longitude notation string for the coordinate.

spatialReference

A spatial reference that defines the datum and ellipsoid referenced by the latitude-longitude coordinate.

Returns ArcGISPoint

A point with the location from the coordinate string in the spatial reference provided.

FromMGRS

static ArcGISPoint FromMGRS(string coordinates, ArcGISSpatialReference spatialReference, ArcGISMGRSConversionMode MGRSConversionMode)

Parses a coordinate in Military Grid Reference System (MGRS) notation, and returns a Point representing that location.

Since 1.0.0

Arguments
NameTypeSummary
coordinates

The MGRS notation string for the coordinate.

spatialReference

A spatial reference that defines the datum and ellipsoid referenced by the MGRS coordinate.

MGRSConversionMode

The mode used by the given MGRS coordinates.

Returns ArcGISPoint

A point with the location from the MGRS string in the spatial reference provided.

FromUSNG

static ArcGISPoint FromUSNG(string coordinates, ArcGISSpatialReference spatialReference)

Parses a coordinate in United States National Grid (USNG) notation, and returns a Point representing that location.

Since 1.0.0

Arguments
NameTypeSummary
coordinates

The USNG notation string for the coordinate.

spatialReference

A spatial reference that defines the datum and ellipsoid referenced by the USNG coordinate.

Returns ArcGISPoint

A point with the location from the USNG string in the spatial reference provided.

FromUTM

static ArcGISPoint FromUTM(string coordinates, ArcGISSpatialReference spatialReference, ArcGISUTMConversionMode UTMConversionMode)

Parses a coordinate in Universal Transverse Mercator (UTM) notation, and returns a Point representing that location.

Since 1.0.0

Arguments
NameTypeSummary
coordinates

The UTM notation string for the coordinate.

spatialReference

A spatial reference that defines the datum and ellipsoid referenced by the UTM coordinate.

UTMConversionMode

The latitude notation scheme used by the given UTM coordinate, either a latitudinal band, or a hemisphere designator.

Returns ArcGISPoint

A point with the location from the UTM string in the spatial reference provided.

ToGARS

static string ToGARS(ArcGISPoint point)

Returns a formatted coordinate in Global Area Reference System (GARS) notation representing the given point's location.

Since 1.0.0

Arguments
NameTypeSummary
point

The location to be represented in GARS notation.

Returns string

A GARS notation string representing the GARS cell containing the given point.

ToGeoRef

static string ToGeoRef(ArcGISPoint point, int precision)

Returns a formatted coordinate in World Geographic Reference System (GEOREF) notation representing the given point's location.

Since 1.0.0

Arguments
NameTypeSummary
point

The location to be represented in GEOREF notation.

precision

The precision with which to represent the coordinate.

Returns string

A GEOREF notation string representing the position of the given point.

ToLatitudeLongitude

static string ToLatitudeLongitude(ArcGISPoint point, ArcGISLatitudeLongitudeFormat format, int decimalPlaces)

Returns a formatted coordinate in latitude-longitude notation representing the given point's location.

Since 1.0.0

Arguments
NameTypeSummary
point

The location to be represented as a formatted latitude-longitude string.

format

The mode to use when formatting the latitude-longitude string.

decimalPlaces

The number of decimal places to use.

Returns string

A string representing the latitude-longitude of the given point.

ToMGRS

static string ToMGRS(ArcGISPoint point, ArcGISMGRSConversionMode MGRSConversionMode, int precision, bool addSpaces)

Returns a formatted coordinate in Military Grid Reference System (MGRS) notation representing the given point's location.

Since 1.0.0

Arguments
NameTypeSummary
point

The location to be represented in MGRS notation.

MGRSConversionMode

The mode to use for the returned MGRS notation string.

precision

The precision with which to represent the coordinate.

addSpaces

If false, the generated string contains no spaces. If true, a space separates the grid zone designator, the 100km square identifier, and the numerical easting and northing values.

Returns string

An MGRS notation string representing the position of the given point.

ToUSNG

static string ToUSNG(ArcGISPoint point, int precision, bool addSpaces)

Returns a formatted coordinate in United States National Grid (USNG) notation representing the given point's location.

Since 1.0.0

Arguments
NameTypeSummary
point

The coordinate to be represented in MGRS notation.

precision

The precision with which to represent the coordinate.

addSpaces

If false, the generated string contains no spaces. If true, a space separates the grid zone designator, the 100km square identifier, and the numerical easting and northing values.

Returns string

A USNG notation string representing the position of the given point.

ToUTM

static string ToUTM(ArcGISPoint point, ArcGISUTMConversionMode UTMConversionMode, bool addSpaces)

Returns a formatted coordinate in Universal Transverse Mercator (UTM) notation representing the given point's location.

Since 1.0.0

Arguments
NameTypeSummary
point

The coordinate to be represented in UTM notation.

UTMConversionMode

The latitude notation scheme to use in the returned UTM notation string, either a latitudinal band, or a hemisphere designator.

addSpaces

If false, the generated string contains no spaces. If true, a space separates the UTM zone and latitude designator, and each numerical easting and northing value.

Returns string

A UTM notation string representing the position of the given point.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.