From GeoCoordinateString
- URL:http://<geometry service url>/fromGeoCoordinateString
- Related Resources:To GeoCoordinateString
- Version Introduced:10.3
Description
The fromGeoCoordinateString operation is performed on a geometry service resource. The operation converts an array of well-known strings into xy-coordinates based on the conversion type and spatial reference supplied by the user. An optional conversion mode parameter is available for some conversion types.
Request Parameters
Parameter | Details |
|---|---|
| f |
Description: (Optional) The response format. The default response format is html. Values: html | json |
| sr | Description: The well-known ID of the spatial reference or a spatial reference json object. For a list of valid WKID values, see Projected coordinate Systems and Geographic coordinate Systems. |
| strings | An array of strings formatted as specified by conversionType. Syntax: [<string1>,...,<stringN>] Example: ["01N AA 66021 00000","11S NT 00000 62155","31U BT 94071 65288"] |
| conversionType | Description: The conversion type of the input strings. Valid conversion types are:
|
| conversionMode | Description: (Optional) Conversion options for MGRS, UTM and GARS conversion types. Valid conversion modes for MGRS are:
Valid conversion modes for UTM are:
Valid conversion modes for GARS are:
|
Example Usage
In this example we convert three strings in the World Geographic Reference System (GeoRef) format to xy-coordinates.
http://<geometry service url>/fromGeoCoordinateString?sr=4326&strings=["ZGQA5999999900000000","EJCE3864000012728040","NKBH1196052000273924" ]&conversionType=GeoRef
JSON Response Syntax
The output is a JSON object containing an array of xy-coordinates.
{"coordinates":[[x1,y1],...,[xN,yN]]}
JSON Response Example
The output from the above example is a JSON object containing a 3-element array of xy-coordinates.
{"coordinates": [
[
179.99999998333334,
0
],
[
-117.356,
34.212134
],
[
1.199342,
52.0045654
]
]}