fromUsngOrNull

fun fromUsngOrNull(coordinates: String, spatialReference: SpatialReference?): Point?

Parses a coordinate in United States National Grid (USNG) notation, and returns a Point representing that location. The spatial reference provided must have an ellipsoid and datum matching those used by the source of the USNG string. If no spatial reference is provided and the USNG string is suffixed with "(NAD 27)", it is assumed the USNG string is referenced to NAD 27. If no spatial reference is provided and no such suffix exists, it is assumed the USNG string is referenced to WGS 84. The USNG string can contain leading and trailing whitespace and can have whitespace between the grid zone designator, the 100km square identifier and the numerical eastings and northings.

USNG notation examples
13TFJ 23 59
13TFJ2374159574
Returns null on error, including when the given string is not valid USNG notation.

Return

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

Since

200.1.0

See also