Measure to Geometry
- URL:https://<network-layer-url>/measureToGeometry
- Version Introduced:10.6
Description
License:The ArcGIS Pipeline Referencing Server extension 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), an indication is returned with the reason the conversion failed. The following table lists the possible locating statuses:
Status | Description |
|---|---|
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
Parameter | Details |
|---|---|
| f | Description: 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: |
| 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: 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
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 }
}
}