- URL:
- https://<network-layer-url>/geometryToMeasure
- Methods:
GET
- Required Capability:
- The ArcGIS Location Referencing license is required to use this resource.
- Version Introduced:
- 10.6
Description
This operation converts one or more geographic locations into measure values along a set of routes.
If a point location cannot be converted to a measure value, a status message is returned with the reason the conversion failed. The following table lists the possible locating statuses.
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 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 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. |
Request parameters
Parameter | Details |
---|---|
(Optional) |
Specifies the response format. The default response format is Values: |
(Required) | Lists routes and point locations to convert to measure values. If the route ID is omitted for a given point, the point is located on all nearby routes within the tolerance. In that case, the response contains multiple route IDs and measure values corresponding to the single point location. Syntax:
|
| The maximum distance in map units to snap a point to the closest location on a nearby route. If a point is farther than the tolerance from a route, an indication is returned that the point can't be located. If a route ID is provided in the locations parameter in the request, the tolerance parameter is ignored and only the route ID is considered. |
|
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 input geometry. The spatial reference can be specified as either a Well-Known ID (WKID) or a spatial reference JSON object. If |
|
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 |
(Optional) |
Specifies the geodatabase version to use. If this parameter is not specified, the published map's version is used. Syntax:
Example:
|
Example usage
Example 1
URL for converting a single point to a measure
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/1/geometryToMeasure?f=json&locations=[{"routeId":"I90","geometry":{"x":-8479115,"y":5326520}}]&tolerance=50&inSR=102100
Example 2
URL for converting multiple points to measures
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/1/geometryToMeasure?f=json&locations=[{"routeId":"I90","geometry":{"x":-8479115,"y":5326520}},{"routeId":"US20","geometry":{"x":-8472692,"y":5295686}}]&tolerance=25&inSR=102100
Example 3
URL for converting a single point on any nearby route to one or more measures
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/1/geometryToMeasure?f=json&locations=[{"geometry":{"x":-8479100,"y":5326500}}]&tolerance=100&inSR=102100
JSON Response syntax
{
"unitsOfMeasure": "<units>",
"spatialReference": <>,
"locations": [
{ // result(s) for the first point location
"status": "<status1>",
"results": [
{
"routeId": "<routeId1>",
"measure": <measure1>,
"distance": <distance1>, // in xy units of spatial reference, or in meters if the network's spatial reference is a geographic coordinate system
"geometryType": "<geometryType1>", // esriGeometryPoint
"geometry": { "x": <x>, "y": <y> }
},
...
]
},
{ // result(s) for the second point location
"status": "<status2>",
"results": [
{
"routeId": "<routeId2>",
"measure": <measure2>,
"distance": <distance2>,
"geometryType": "<geometryType2>",
"geometry": { "x": <x>, "y": <y> }
},
...
]
},
...
]
}
JSON Response example
{
"unitsOfMeasure": "esriMeters",
"spatialReference": { "wkid": 102100 },
"locations": [
{
"status": "esriLocatingOK",
"results": [
{
"routeId": "I90",
"measure": 25.05,
"distance": 1.23,
"geometryType": "esriGeometryPoint",
"geometry": { "x": -8479118.349, "y": 5326520.134 }
}
]
}
]
}