From GeoCoordinateString

URL:
https://<root>/Utilities/Geometry/GeometryServer/fromGeoCoordinateString
Methods:
GET
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 x,y 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

ParameterDetails

sr

Specifies the well-known ID of the spatial reference or a spatial reference json object. For a list of valid WKID values, see Using a spatial reference.

strings

Specifies an array of strings formatted as specified by conversionType.

Syntax

Use dark colors for code blocksCopy
1
[<string1>,...,<stringN>]

Example

Use dark colors for code blocksCopy
1
["01N AA 66021 00000","11S NT 00000 62155","31U BT 94071 65288"]

conversionType

Specifies the conversion type of the input strings.

The following are valid conversion types:

  • MGRS - Military Grid Reference System

  • USNG - United States National Grid

  • UTM - Universal Transverse Mercator

  • GeoRef - World Geographic Reference System

  • GARS - Global Area Reference System

  • DMS - Degree Minute Second

  • DDM - Degree Decimal Minute

  • DD - Decimal Degree

conversionMode

(Optional)

Specifies the conversion options for MGRS, UTM, and GARS conversion types.

The following are valid conversion modes for MGRS :

  • mgrsDefault - Default. Uses the spheroid from the given spatial reference.

  • mgrsNewStyle - Treats all spheroids as new, like WGS 1984. The 180 degree longitude falls into Zone 60.

  • mgrsOldStyle - Treats all spheroids as old, like Bessel 1841. The 180 degree longitude falls into Zone 60.

  • mgrsNewWith180InZone01 - Same as mgrsNewStyle except the 180 degree longitude falls into Zone 01.

  • mgrsOldWith180InZone01 - Same as mgrsOldStyle except the 180 degree longitude falls into Zone 01.

The following are valid conversion modes for UTM :

  • utmDefault - Default. No options.

  • utmNorthSouth - Uses north/south latitude indicators instead of zone numbers. Non-standard. Default is recommended.

The following are valid conversion modes for GARS :

  • garsDefault —Default. Same as garsLowerLeft . Point at the lower left corner of the box.
  • garsLowerLeft —Point at the lower left corner of the box.
  • garsCenter —Point at the center of the box.

f

The response format. The default format is html.

Values: html | json | pjson

Example usage

The following is a sample request URL for fromGeoCoordinateString. In this example, three strings are converted in the World Geographic Reference System (GeoRef) format to x,y coordinates.

Use dark colors for code blocksCopy
1
https://<machineName>.<domain>.com/webadaptor/rest/services/Utilities/Geometry/GeometryServer/fromGeoCoordinateString?sr=4326&strings=["ZGQA5999999900000000","EJCE3864000012728040","NKBH1196052000273924" ]&conversionType=GeoRef&f=pjson

JSON Response syntax

The output is a JSON object containing an array of x,y coordinates.

Use dark colors for code blocksCopy
1
{"coordinates":[[x1,y1],...,[xN,yN]]}

JSON Response example

The output from the above example is a JSON object containing a three-element array of x,y coordinates.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
  "coordinates": [
    [
      179.99999998333334,
      0
    ],
    [
      -117.356,
      34.212134
    ],
    [
      1.199342,
      52.0045654
    ]
  ]
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.