Skip To Content

Station To Geometry

Description

License:

The ArcGIS Location Referencing license is required to use this resource.

This operation converts one or more station values to geographic locations 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.

esriLocatingInvalidRouteId

The route location's route ID is invalid (null, empty, or invalid value).

esriLocatingInvalidMeasure

At least one of the route location's station values is invalid.

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.

esriLocatingNullExtent

The from station is equal to the to station.

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.

esriLocatingCannotFindExtent

The route location's shape cannot be found because the from station and the to station are outside of the route measures.

esriLocatingFromPartialMatch

The route location's shape cannot be found because the from station is outside of the route measure range.

esriLocatingToPartialMatch

The route location's shape cannot be found because the to station is outside of the route measure range.

esriLocatingFromToPartialMatch

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

ParameterDetails
f

Optional parameter to specify the response format. The default response format is html.

Values: html | json

locations

Description: A list of routes and station values to convert to geometry.

Syntax:


{ // syntax of a single station to translate to a point geometry
    "routeId" : "<routeId1>",
    "station" : "<station1>"
  },
  { // syntax of a station range to translate to a line geometry
    "routeId" : "<routeId2>",
    "fromStation" : "<station2>",
    "toStation" : "<station3>"
  },
  { // syntax of a station range that spans different routes on the same line to translate to a line geometry
    "routeId" : "<routeId3>",
    "toRouteId" : "<routeId4>",
    "fromStation" : "<station4>",
    "toStation" : "<station5>"
  },    
  ...
]

temporalViewDate

The time instant to use as a temporal view date when locating route features.

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

Syntax: temporalViewDate=<timeInstant>

Example: temporalViewDate=1230768000000 (1 Jan 2009 00:00:00 GMT)

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 geometry is returned 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 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=102100

Example 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=102100

Example 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=102100

Example 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=102100

Example 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=102100

JSON 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" } ]
    }
  ]
}