Geometry To Station

URL:
https://<event-layer-url>/geometryToStation
Methods:
GET
Required Capability:
The ArcGIS Location Referencing license is required to use this resource.
Version Introduced:
11.0

Description

This operation converts one or more geographic locations to station values along a set of routes in station-enabled event layers when the isStationEvent property is true.

A status message is returned indicating either success or why the conversion failed.

Status messages

The following table contains an enumeration of the possible locating statuses:

StatusDescription

esriLocatingOK

Locating was successful.

esriLocatingMultipleLocation

Locating was successful and the input point was located on more than one route.

esriLocatingCannotFindRoute

The route does not exist.

esriLocatingRouteShapeEmpty

The route does not have a shape or the shape is empty.

esriLocatingRouteMeasuresNull

The route does not have measures or the measures are null.

esriLocatingRouteNotMAware

The route is not an m-aware polyline.

esriLocatingCannotFindLocation

The route location's shape cannot be found because the route has no measures or the route location's measures do not exist on the route.

Request parameters

ParameterDetails

f

(Optional)

Specifies the response format. The default response format is html.

Values: html | json | pjson

locations

(Required)

Lists routes and point locations to convert to station values.

If the route ID is omitted for a given point, the point is located on all nearby routes within the tolerance. In this case, the response contains multiple route IDs and station values corresponding to the single point location.

Syntax:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
[
  {
    "routeId": "<routeId1>",  // route ID is optional, may be omitted or null
    "geometry": { "x": <x1>, "y": <y1>, "z": <z1> }
  },
  {
    "routeId": "<routeId2>",  // route ID is optional, may be omitted or null
    "geometry": { "x": <x2>, "y": <y2>, "z": <z2> }
  },
  ...
]

tolerance

The maximum distance in map units allowed to snap a point to the closest location on a nearby route. If a point is farther than the tolerance from a route, a message is returned that the point is not locatable.

temporalViewDate

The time instant to use as a temporal view date when locating route features. If this parameter is not specified, the current date is used.

The parameter value is a number that represents the number of milliseconds since epoch (January 1, 1970) in UTC.

Syntax:

Use dark colors for code blocksCopy
1
temporalViewDate=<timeInstant>

Example:

Use dark colors for code blocksCopy
1
temporalViewDate=1230768000000 (1 Jan 2009 00:00:00 GMT)

inSR

The spatial reference of the input geometry.

The spatial reference can be specified as either a Well-Known ID (WKID) or a spatial reference JSON object.

If inSR is not specified, the geometry is assumed to be in the spatial reference of the map.

outSR

The spatial reference of the returned geometry.

The spatial reference can be specified as either a Well-Known ID (WKID) or a spatial reference JSON object.

If outSR is not specified, the output geometries are in the spatial reference specified by inSR. If inSR is also not specified, the output geometries are in the spatial reference of the map.

gdbVersion

The geodatabase version to use for the network feature class. This parameter applies only if the isDataVersioned property of the network layer is true.

If this parameter is not specified, the published map's version is used.

Example usage

The following are sample URLs for geometry to station.

Example 1

The following is a URL for converting a single point to a station:

Use dark colors for code blocksCopy
1
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/eventLayers/1/geometryToStation?f=json&locations=[{"routeId":"I90","geometry":{"x":-8479115,"y":5326520,"z":5}}]&tolerance=50&inSR=102100

Example 2

The following is a URL for converting multiple points to stations:

Use dark colors for code blocksCopy
1
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/eventLayers/1/geometryToStation?f=json&locations=[{"routeId":"I90","geometry":{"x":-8479115,"y":5326520,"z":5}},{"routeId":"US20","geometry":{"x":-8472692,"y":5295686,"z":5}}]&tolerance=25&inSR=102100

Example 3

The following is a URL for converting a single point on any nearby route to one or more stations:

Use dark colors for code blocksCopy
1
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/eventLayers/1/geometryToStation?f=json&locations=[{"geometry":{"x":-8479100,"y":5326500,"z":5}}]&tolerance=100&inSR=102100

JSON Response syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
  "stationUnits": "<units>",
  "spatialReference": <spatialReference>,
  "locations": [
    { // result(s) for the first point location
      "status": "<status1>",
      "results": [
        {
          "routeId": "<routeId1>",
          "eventId": "<stationEventId1>",
          "station": "<station1>",
          "geometryType": "<geometryType1>",  // esriGeometryPoint
          "geometry": { "x": <x>, "y": <y>, "m": <m>, "z": <z> }
        },
        ...
      ]
    },
    { // result(s) for the second point location
      "status": "<status2>",
      "results": [
        {
          "routeId": "<routeId2>",
          "eventId": "<stationEventId2>",
          "station": "<station2>",
          "geometryType": "<geometryType2>",
          "geometry": { "x": <x>, "y": <y>, "m": <m>, "z": <z> }
        },
        ...
      ]
    },
    ...
  ]
}

JSON Response example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  "stationUnits": "esriFeet",
  "spatialReference": { "wkid": 102100 },
  "locations": [
    {
      "status": "esriLocatingOK",
      "results": [
        {
          "routeId": "I90",
          "eventId": "Stn123",
          "station": "7+05.12",
          "geometryType": "esriGeometryPoint",
          "geometry": { "x": -8479118.349, "y": 5326520.134, "m": 10.4518, "z": 5 }
        }
      ]
    }
  ]
}

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