- URL:
 - https://<event-layer-url>/stationToGeometry
 - 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 station values to geographic locations along a set of routes in station-enabled event layers whe n the i 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:
| Status | Description | 
|---|---|
| 
 
  | 
 Locating was successful.  | 
| 
 
  | 
 Locating was successful and the input point was located on more than one route.  | 
| 
 
  | 
 The route location's route ID is invalid (null, empty, or invalid value).  | 
| 
 
  | At least one of the route location's station values is invalid.  | 
| 
 
  | 
 The route does not exist.  | 
| 
 
  | 
 The route does not have a shape or the shape is empty.  | 
| 
 
  | 
 The route does not have measures or the measures are null.  | 
| 
 
  | 
 The route is not an m-aware polyline.  | 
  | The from station is equal to the to station.  | 
| 
 
  | 
 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.  | 
  | 
 The route location's shape cannot be found because the from station and the to station are outside of the route measures.  | 
| 
 
  | The route location's shape cannot be found because the from station is outside of the route measure range.  | 
| 
 
  | 
 The route location's shape cannot be found because the to station is outside of the route measure range.  | 
| 
 
  | The route location's shape cannot be found because the from station and the to station are outside of the route measure range.  | 
Request parameters
| Parameter | Details | 
|---|---|
 (Optional)  | 
 Specifies the response format. The default response format is  Values:   | 
  | A list of routes and station values to convert to geometry. Syntax:  | 
  | 
 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: Example:  | 
  | 
 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   | 
  | 
 The geodatabase version to use for the network feature class. This parameter applies only if the  If this parameter is not specified, the published map's version is used.  | 
Example usage
The following are sample URLs for station to geometry.
Example 1
The following is a URL for converting a single station value to point geometry:
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/eventLayers/1/stationToGeometry?f=json&locations=[{"routeId":"I90","station":"7+05.12"}]&outSR=102100Example 2
The following is a URL for converting a station range to line geometry:
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/eventLayers/1/stationToGeometry?f=json&locations=[{"routeId":"I90","fromStation":"0+25.1","toStation":"0+26.8"}]&outSR=102100Example 3
The following is a URL for converting multiple stations to point geometry:
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/eventLayers/1/stationToGeometry?f=json&locations=[{"routeId":"I90","station":"7+05.12"},{"routeId":"US20","station":"8+72"}]&outSR=102100Example 4
The following is a URL for converting multiple stations and station ranges to point and line geometry:
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/eventLayers/1/stationToGeometry?f=json&locations=[{"routeId":"I90","fromStation":"0+25.1","toStation":"0+26.8"},{"routeId":"US20","station":"7+02.6"}]&outSR=102100Example 5
The following is a URL for converting a station range that spans different routes on the same line to line geometry:
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/eventLayers/1/stationToGeometry?f=json&locations=[{"routeId":"I90", "toRouteId":"I91","fromStation":"0+25.1","toStation":"0+26.8"}]&outSR=102100JSON Response syntax
{
  "spatialReference": <spatialReference>,
  "locations": [
    {
      "status": "<status1>",
      "routeId": "<routeId1>",
      "geometryType": "<geometryType1>",  // one of: esriGeometryPoint, esriGeometryPolyline
      "geometries": [ { "x": <x>, "y": <y>, "z": <z>, "m": <m> }, ... ],  // syntax for point geometry, the "z" property is present only for Z-enabled datasets
      "stationEvents": [ { "eventId": "<eventId1>" }, ... ]
    },
    {
      "status": "<status2>",
      "routeId": "<routeId2>",
      "geometryType": "<geometryType2>",
      "geometries": [ { "paths": [ [ [<x1>,<y1>,<z1>,<m1>], [<x2>,<y2>,<z2>,<m2>], ... ] ] } ],  // syntax for line geometry, the Z coordinates are present only for Z-enabled datasets
      "stationEvents": [ { "eventId": "<eventId2>" } ]
    },
    {
      "status": "<status3>",
      "routeId": "<routeId3>",
      "toRouteId": "<routeId4>",
      "geometryType": "<geometryType2>",
      "geometries": [ { "paths": [ [ [<x1>,<y1>,<z1>,<m1>], [<x2>,<y2>,<z2>,<m2>], ... ] ] } ],  // syntax for line geometry, the Z coordinates are present only for Z-enabled datasets
      "stationEvents": [ { "fromEventId": "<eventId3>", "toEventId": <eventId4>" } ]
    },
    ...
}JSON Response example
{
  "spatialReference": { "wkid": 102100 },
  "locations": [
    {
      "status": "esriLocatingOK",
      "routeId": "I90",
      "geometryType": "esriGeometryPoint",
      "geometries": [
        { "x": -8479118.349, "y": 5326520.134, "z": 0, "m": 10.4518 },
        { "x": -8472538.426, "y": 5323848.684, "z": 0, "m": 34.5748 }
      ],
      "stationEvents": [{ "eventId": "Stn123" }, { "eventId": "Stn150" }]
    },
    {
      "status": "esriLocatingOK",
      "routeId": "I90",
      "geometryType": "esriGeometryPolyline",
      "geometries": [
        {
          "paths": [
            [
              [-8479118.349, 5326520.134, 0, 10.4518],
              [-8473550.2546, 5326429.3844, 0, 11.901]
            ]
          ]
        }
      ],
      "stationEvents": [{ "fromEventId": "Stn123", "toEventId": "Stn142" }]
    },
    {
      "status": "esriLocatingOK",
      "routeId": "I90",
      "toRouteId": "I91",
      "geometryType": "esriGeometryPolyline",
      "geometries": [
        {
          "paths": [
            [
              [-8479119.349, 5326521.134, 0, 11.4518],
              [-8473551.2546, 5326430.3844, 0, 12.901]
            ]
          ]
        }
      ],
      "stationEvents": [{ "fromEventId": "Stn124", "toEventId": "Stn125" }]
    }
  ]
}