Skip To Content

Measure To Geometry

Description

License:

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

This operation 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), a status message is returned with the reason the conversion failed.

Status messages

The following table contains an enumeration of 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

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.

esriLocatingCannotFindLocation

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

esriLocatingFromPartialMatch

The entire route location's shape could not be found; the from measure is outside of the route measure range.

esriLocatingToPartialMatch

The entire route location's shape could not be found; the to measure is outside of the route measure range.

esriLocatingFromToPartialMatch

The route location's shape cannot be found because the to station is 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

Optional parameter to specify 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

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

Optional parameter to specify the geodatabase version to use. If this parameter is not specified, the published map's version is used.

Syntax: gdbVersion=<version>

Example: gdbVersion="user1.version1"

Example usage

The following examples demonstrate conversion from measure to geometry.

Example 1

URL for converting a single measure to point geometry

https://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

https://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

https://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

https://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 }
    }
  ]
}