fromLatitudeLongitude static method
- {required String coordinates,
- required SpatialReference? 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.
The spatial reference provided must have an ellipsoid and datum matching those used by the source of the latitude-longitude string. If no spatial reference is provided, it is assumed the latitude-longitude coordinates are referenced to WGS 84.
Symbol | Character | Name | Unicode number | HTML code |
---|---|---|---|---|
Degree | * | Asterisk | U+002A | * |
^ | Circumflex Accent | U+005E | ^ | |
~ | Tilde | U+007E | ~ | |
° | Degree Sign | U+00B0 | ° | |
º | Masculine Ordinal Indicator | U+00BA | º | |
˚ | Ring Above | U+02DA | ˚ | |
⁰ | Superscript Zero | U+2070 | ⁰ | |
Minute | ' | Apostrophe | U+0027 | ' |
’ | Right Single Quotation Mark | U+2019 | ᾿ | |
′ | Prime | U+2032 | ′ | |
Second | " | Quotation Mark | U+0022 | " |
˝ | Double Acute Accent | U+02DD | ˝ | |
” | Right Double Quotation Mark | U+201D | ” | |
″ | Double Prime | U+2033 | ″ |
Latitude-longitude notation examples |
---|
55 56 39.123N 003 09 43.034W |
55°56′39″N 3°09′43″W |
55~56.65205', -003~09.71723' |
55.9442008* | -3.1619539* |
Parameters:
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.
Return Value: A point with the location from the coordinate string in the spatial reference provided.
Implementation
static ArcGISPoint fromLatitudeLongitude(
{required String coordinates,
required SpatialReference? spatialReference}) {
_initializeArcGISEnvironmentIfNeeded();
final coreCoordinates = _CString(coordinates);
final objectHandle = _withThrowingErrorHandler((errorHandler) {
return runtimecore.RT_CoordinateFormatter_fromLatitudeLongitude(
coreCoordinates.bytes,
spatialReference?._handle ?? ffi.nullptr,
errorHandler);
});
return ArcGISPoint._fromHandle(objectHandle)!;
}