Measure to Geometry

Description

Converts one or more measure values into geographic locations along a set of routes.

If the measures cannot be converted to a valid geometry (point or line), an indication is returned with the reason the conversion failed. The following table lists the possible locating statuses.

StatusDescription

esriLocatingOK

Locating was successful.

esriLocatingInvalidRouteId

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

esriLocatingInvalidMeasure

At least one of the route location's measure 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 measure is equal to the to measure.

esriLocatingCannotFindLocation

Could not find the route location's shape (the route has no measures or the route location's measures do not exist on the route).

esriLocatingCannotFindExtent

Could not find the route location's shape; the from measure and the to measure are outside of the route measures.

esriLocatingFromPartialMatch

Could not find the entire route location's shape; the from measure is outside of the route measure range.

esriLocatingToPartialMatch

Could not find the entire route location's shape; the to measure is outside of the route measure range.

esriLocatingFromToPartialMatch

Could not find the entire route location's shape; the from measure and the to-measure are outside of the route measure range.

esriLocatingInvalidLineId

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

esriLocatingInvalidLineOrder

The route's line order is invalid (null, empty, or invalid value).

esriLocatingDifferentLineIds

The from route and to route have different line IDs.

Request Parameters

ParameterDetails
f

Description: The response format. The default response format is html.

Values: html | json

locations

Required

Description: A list of routes and point locations to convert to geometry.

Syntax:

[
  { // syntax of a single measure to translate to a point geometry
    "routeId" : "<routeId1>",
    "measure" : <measure1>
  },
  { // syntax of a measure range to translate to a line geometry
    "routeId" : "<routeId2>",
    "fromMeasure" : <measure2a>,
    "toMeasure" : <measure2b>
  },
  { // syntax of a measure range spanning multiple routes to translate to a line geometry
    // this is valid only for networks that support lines
    "routeId" : "<routeId3a>",
    "toRouteId" : "<routeId3b>",
    "fromMeasure" : <measure3a>,
    "toMeasure" : <measure3b>
  },
  ...
]
temporalViewDate

Description: 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

Description: The spatial reference of the returned geometry.

The spatial reference can be specified as either a well-known ID or as 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, they are in the spatial reference of the map.

gdbVersion

Description: 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

Example 1

URL for converting a single measure to point geometry.

http://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/0/measureToGeometry?f=json&locations=[{"routeId":"I90","measure":25}]&outSR=102100

Example 2

URL for converting a measure range to line geometry.

http://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/0/measureToGeometry?f=json&locations=[{"routeId":"I90","fromMeasure":25.1,"toMeasure":26.8}]&outSR=102100

Example 3

URL for converting multiple measures to point geometry.

http://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/0/measureToGeometry?f=json&locations=[{"routeId":"I90","measure":25.0},{"routeId":"US20","measure":72.6}]&outSR=102100

Example 4

URL for converting multiple measures and measure ranges to point and line geometry.

http://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/0/measureToGeometry?f=json&locations=[{"routeId":"I90","fromMeasure":25.1,"toMeasure":26.8},{"routeId":"US20","measure":72.6}]&outSR=102100

JSON Response Syntax

{
  "spatialReference" : <spatialReference>,
  "locations" : [
    {
      "status" : "<status1>",
      "routeId" : "<routeId1>",
      "geometryType" : "<geometryType1>",  // one of: esriGeometryPoint, esriGeometryPolyline
      "geometry" : { "x" : <x>, "y" : <y> }  // syntax for point geometry
    },
    {
      "status" : "<status2>",
      "routeId" : "<routeId2>",
      "geometryType" : "<geometryType2>",
      "geometry" : { "paths" : [ [ [<x1>,<y1>], [<x2>,<y2>], ... ] ] }  // syntax for line geometry
    },
    {
      "status" : "<status3>",
      "routeId" : "<routeId3a>",
      "toRouteId" : "<routeId3b>",
      "geometryType" : "<geometryType3>",
      "geometry" : { "paths" : [ [ [<x1>,<y1>], [<x2>,<y2>], ... ] ] }  // syntax for line geometry that spans multiple routes
    },
    ...
}

JSON Response Example

{
  "spatialReference" : { "wkid": 102100 },
  "locations" : [
    {
      "status" : "esriLocatingOK",
      "routeId" : "I90",
      "geometryType" : "esriGeometryPoint",
      "geometry" : { "x" : -8479118.349, "y" : 5326520.134 }
    }
}