- URL:https://<network-layer-url>/translate
- Version Introduced:10.6
Description
License:
The ArcGIS Location Referencing license is required to use this resource.
This operation translates route measures from one network's linear referencing method (LRM) to that of another network. This operation can be used to locate concurrent routes in a target network.
Request parameters
Parameter | Details |
---|---|
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 measure values to translate. Syntax:
|
targetNetworkLayerIds | Required Description: A comma-separated list of layer IDs into which the network layers translate. Example: targetNetworkLayerIds=[4,7] |
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) |
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 measure translation.
Example 1
URL for translating the entire measure span of a route.
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/0/translate?f=json&locations=[{"routeId":"I90"}]&targetNetworkLayerIds=[4]
Example 2
URL for translating a single measure on a route.
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/0/translate?f=json&locations=[{"routeId":"I90","measure":25}]&targetNetworkLayerIds=[2,5]
Example 3
URL for translating a measure range on a route.
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/0/translate?f=json&locations=[{"routeId":"I90","fromMeasure":25.1,"toMeasure":26.8}]&targetNetworkLayerIds=[4]
Example 4
URL for translating measures on multiple routes.
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRSServer/networkLayers/0/translate?f=json&locations=[{"routeId":"I90","measure":25.0},{"routeId":"US20","measure":72.6}]&targetNetworkLayerIds=[4]
Example 5
URL for translating multiple measures and measure ranges.
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRSServer/networkLayers/0/translate?f=json&locations=[{"routeId":"I90","fromMeasure":25.1,"toMeasure":26.8},{"routeId":"US20","measure":72.6}]&targetNetworkLayerIds=[2,5]
JSON response syntax
{
"locations" : [
{
// source location properties for a measure range
"routeId" : "<routeId>",
"fromMeasure" : <measure>,
"toMeasure" : <measure>,
"networkLayerIdsWithoutFullCoverage" : [<layerId1>, <layerId2>, ...], // will only show up when translating from a line network with multifield routeId.
"translatedLocations" : [
// target network location properties
{
"networkLayerId" : <layerId>,
"routeId" : "<routeId>",
"fromMeasure" : <measure>,
"toMeasure" : <measure>
},
{
"networkLayerId" : <layerId>,
"routeId" : "<routeId>",
"fromMeasure" : <measure>,
"toMeasure" : <measure>
},
...
]
},
{
// source location properties for a single measure
"routeId" : "<routeId>",
"measure" : <measure>,
"translatedLocations" : [
// target network location properties
{
"networkLayerId" : <layerId>,
"routeId" : "<routeId>",
"measure" : <measure>
},
{
"networkLayerId" : <layerId>,
"routeId" : "<routeId>",
"measure" : <measure>
},
...
]
},
...
]
}
JSON response example
{
"locations" : [
{
"routeId" : "US101",
"measure" : 10,
"translatedLocations" : [
{
"networkLayerId" : 4,
"routeId" : "9002451556",
"measure" : 4592.22
}
]
},
{
"routeId" : "I90",
"fromMeasure" : 0,
"toMeasure" : 5,
"networkLayerIdsWithoutFullCoverage": [
5
],
"translatedLocations" : [
{
"networkLayerId" : 4,
"routeId" : "9006322627",
"fromMeasure" : 392.562,
"toMeasure" : 1034.81
},
{
"networkLayerId" : 7,
"routeId" : "A10004579",
"fromMeasure" : 0.5,
"toMeasure" : 1.76
},
{
"networkLayerId" : 7,
"routeId" : "A10004580",
"fromMeasure" : 1.76,
"toMeasure" : 5
}
]
}
]
}