- URL:
- https://<root>/Utilities/Geometry/GeometryServer/toGeoCoordinateString
- Methods:
GET
- Version Introduced:
- 10.3
Description
The to
operation is performed on a geometry service resource. The operation converts an array of x,y coordinates into well-known strings based on the conversion type and spatial reference supplied by the user. Optional parameters are available for some conversion types. Note that if an optional parameter is not applicable for a particular conversion type, but a value is supplied for that parameter, the value will be ignored.
Request parameters
Parameter | Details |
---|---|
| Specifies the well-known ID of the spatial reference or a spatial reference json object. For a list of valid WKID values, see Using spatial references. |
| Specifies an array of x,y coordinates in JSON format to be converted. Syntax
Example
|
| Specifies the conversion type of the input strings. Valid conversion types are as follows:
|
(Optional) | Specifies the conversion options for MGRS and UTM conversion types. Valid conversion modes for MGRS are as follows:
Valid conversion modes for UTM are as follows:
|
(Optional) | Sets the number of digits to output for each of the numerical portions in the string. The default value for
|
(Optional) | If Values: |
(Optional) | If Values: |
| The response format. The default format is Values: |
Example usage
The following is a sample request URL for to
that demonstrates how to convert three sets of x,y coordinates to geographic strings in MGRS.
https://<machineName>.<domain>.com/webadaptor/rest/services/Utilities/Geometry/GeometryServer/toGeoCoordinateString?sr=4326&coordinates=[[180,0],[-117,34],[0,52]]&conversionType=MGRS&conversionMode=mgrsNewWith180InZone01&numOfDigits=8&addSpaces=true&f=pjson
JSON Response syntax
The output is a JSON object containing an array of strings.
{"strings":[<string1>,...,<stringN>]}
JSON Response example
The output of the example given above is a JSON object containing an array of three strings. Notice that 180 degrees longitude is in Zone 01.
{
"strings": [
"01N AA 66021443 00000000",
"11S NT 00000000 62155978",
"31U BT 94071081 65288255"
]
}