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
| Signature | Return Type | Summary |
|---|---|---|
FromGARS(string, ArcGISSpatialReference, ArcGISGARSConversionMode) | Parses a coordinate in Global Area Reference System (GARS) notation, and returns a Point representing that location. | |
Parses a coordinate in World Geographic Reference System (GEOREF) notation, and returns a Point representing that location. | ||
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. If no marks are given to indicate the format, degrees, minutes, and seconds format will be assumed. | ||
FromMGRS(string, ArcGISSpatialReference, ArcGISMGRSConversionMode) | Parses a coordinate in Military Grid Reference System (MGRS) notation, and returns a Point representing that location. | |
Parses a coordinate in United States National Grid (USNG) notation, and returns a Point representing that location. | ||
FromUTM(string, ArcGISSpatialReference, ArcGISUTMConversionMode) | Parses a coordinate in Universal Transverse Mercator (UTM) notation, and returns a Point representing that location. | |
Returns a formatted coordinate in Global Area Reference System (GARS) notation representing the given point's location. | ||
Returns a formatted coordinate in World Geographic Reference System (GEOREF) notation representing the given point's location. | ||
ToLatitudeLongitude(ArcGISPoint, ArcGISLatitudeLongitudeFormat, int) | Returns a formatted coordinate in latitude-longitude notation representing the given point's location. | |
Returns a formatted coordinate in Military Grid Reference System (MGRS) notation representing the given point's location. | ||
ToUSNG(ArcGISPoint, int, bool) | Returns a formatted coordinate in United States National Grid (USNG) notation representing the given point's location. | |
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
| Name | Type | Summary |
|---|---|---|
coordinates | string | The GARS notation string for the coordinate. |
spatial | ArcGISSpatialReference | A spatial reference that defines the datum and ellipsoid referenced by the GARS coordinate. |
GARS | ArcGISGARSConversionMode | 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
| Name | Type | Summary |
|---|---|---|
coordinates | string | The GEOREF notation string for the coordinate. |
spatial | ArcGISSpatialReference | 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. If no marks are given to indicate the format, degrees, minutes, and seconds format will be assumed.
Since 1.0.0
Arguments
| Name | Type | Summary |
|---|---|---|
coordinates | string | The latitude-longitude notation string for the coordinate. |
spatial | ArcGISSpatialReference | 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
| Name | Type | Summary |
|---|---|---|
coordinates | string | The MGRS notation string for the coordinate. |
spatial | ArcGISSpatialReference | A spatial reference that defines the datum and ellipsoid referenced by the MGRS coordinate. |
MGRS | ArcGISMGRSConversionMode | 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
| Name | Type | Summary |
|---|---|---|
coordinates | string | The USNG notation string for the coordinate. |
spatial | ArcGISSpatialReference | 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
| Name | Type | Summary |
|---|---|---|
coordinates | string | The UTM notation string for the coordinate. |
spatial | ArcGISSpatialReference | A spatial reference that defines the datum and ellipsoid referenced by the UTM coordinate. |
UTM | ArcGISUTMConversionMode | 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
| Name | Type | Summary |
|---|---|---|
point | ArcGISPoint | 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
| Name | Type | Summary |
|---|---|---|
point | ArcGISPoint | The location to be represented in GEOREF notation. |
precision | int | 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
| Name | Type | Summary |
|---|---|---|
point | ArcGISPoint | The location to be represented as a formatted latitude-longitude string. |
format | ArcGISLatitudeLongitudeFormat | The mode to use when formatting the latitude-longitude string. |
decimal | int | 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
| Name | Type | Summary |
|---|---|---|
point | ArcGISPoint | The location to be represented in MGRS notation. |
MGRS | ArcGISMGRSConversionMode | The mode to use for the returned MGRS notation string. |
precision | int | The precision with which to represent the coordinate. |
add | bool | 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
| Name | Type | Summary |
|---|---|---|
point | ArcGISPoint | The coordinate to be represented in MGRS notation. |
precision | int | The precision with which to represent the coordinate. |
add | bool | 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
| Name | Type | Summary |
|---|---|---|
point | ArcGISPoint | The coordinate to be represented in UTM notation. |
UTM | ArcGISUTMConversionMode | The latitude notation scheme to use in the returned UTM notation string, either a latitudinal band, or a hemisphere designator. |
add | bool | 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.