Skip To Content ArcGIS for Developers Sign In Dashboard

Update Measures From LRS

  • URL:https://<network-layer-url>/updateMeasuresFromLRS
  • Required Capability:Network Editing
  • Version Introduced:10.8

Description

License:

The ArcGIS Pipeline Referencing for Server extension is required to use this resource.

This operation populates and updates the measures on ArcGIS Utility Network Management extension features such as pipes, devices, and junctions, or features in other non-Utility Network or LRS feature classes. It will find an appropriate route from a specified LRS Network, get the measures from the route, then populate and update the measure attributes for the features on the non-LRS feature class.

Request parameters

ParameterDetails
f

Description: Optional parameter to specify the response format. The default response format is html.

Values: html | json

lrsDate

Description: The epoch date used to define the temporal view of the network for collecting the route and measure values.

Syntax: lrsDate=<epoch date>

Example: lrsDate=1539043200000

inputLayerId

Description: The layer ID value for the feature service layer that includes the route ID and measure fields to update based on the feature geometry relative to routes in the specified LRS Network.

Syntax: inputLayerId=<layer id>

Example: inputLayerId=3

inputLayerDefinition

Description: Optional parameter to specify a list of object IDs or a SQL WHERE clause defining the features on the input layer on which the operation will be performed.

Default: All features on the input layer will be checked to see if the measures on the features need to be updated.

Syntax:

{
    "objectIds": [<objectId1>, <objectId2>, ...]
}

Or

{
    "where": "field1 in ('<value1>', '<value2>', ...)"
}

Example:

{
    "objectIds": [1, 3, 5]
}

{
    "where": "lineId in ('{124EF4E1-D6D7-47CD-A993-6E036584742C}', '{7BC4E070-CD40-40B0-8F13-75C75B3A80CF}')"
}
routeIdFieldName

Description: The name of the field in the Input Layer that contains the route ID value.

Syntax: routeIdFieldName="<field name>"

Example: routeIdFieldName="ROUTEID"

fromMeasureFieldName

Description: The name of the field in the Input Layer that contains the measure value for point features, or the From measure value for polyline features.

Syntax: fromMeasureFieldName="<field name>"

Example: fromMeasureFieldName ="FROMMEASURE"

toMeasureFieldName

Description: The name of the field in the Input Layer that contains the To measure value for polyline features.

Syntax: toMeasureFieldName="<field name>"

Example: toMeasureFieldName ="TOMEASURE"

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"

sessionID

Description: Optional parameter set by a client during long transaction editing on a branch version. The sessionId is a guid value that clients establish at the beginning and use throughout the edit session. The sessonId ensures isolation during the edit session.

Syntax: sessionId=<guid>

Example: sessionId="{E81C2E2D-C6A7-40CB-BF61-FB499E53DD1D}"

returnEditMoment

Description: Optional parameter to specify whether the response will report the time edits that were applied. If returnEditMoment=true, the server will return the time edits that were applied in the response's editMoment key. The default value for this parameter is false.

Values: true|false

returnServiceEditsOption

Description: Optional parameter that returns features edited due to the geodatabase behavior that results from applying the edits. For example, if a feature is deleted and it is the origin in a composite relationship, the destination feature is automatically deleted in the geodatabase. If returnServiceEditsOption is set to originalAndCurrentFeatures, the deleted destination feature is returned along with a reference to the deleted origin feature in the response. Note that, even for deletes, the geometry and attributes of the edited feature are returned.

Results returned from applyEdits are organized in layer-by-layer fashion. If the returnServiceEditsOption is set to originalAndCurrentFeatures, each layer may have edited features returned in an editedFeatures object.

Service-level applyEdits response structure:

[
	{
		id
		addResults
		updateReults
		deleteResults
		attachments: {
			addResults
			updateReults
			deleteResults
		}
		editMoment
		editedFeatures
		exceededTransferLimit                  
	},
	{
	...
	}
]

The editedFeatures object returns full features, including the original features prior to delete, the original and current features for updates, and the current rows for inserts that may contain implicit changes (for example, as a result of a calculation rule).

editedFeatures response structure:

"editedFeatures":{
	"adds":    [ <feature1>, <feature2>], 	// current features
	"updates": [[<originalFeature3>, < currentFeature3>], 	[<originalFeature4>, < currentFeature4>]],
	"deletes": [ <feature5>, <feature6>]	// original features
},

The response includes no editedFeatures and exceededTransferLimit=true if the count of edited features to return is more than the maxRecordCount. If clients are using this parameter to maintain a cache, they should invalidate the cache when exceededTransferLimit = true is returned. If the server encounters an error when generating the list of edits in the response, exceededTransferLimit = true is also returned.

The default for this parameter is none, which will not include editedFeatures.

Edited features are returned in the spatial reference of the feature service as defined by the services spatialReference object or by the spatialReference of the layers extent object.

Values: none|originalAndCurrentFeatures

Example usage

Example 1

URL for updating measures for all features on the polyline feature layer:

https://sampleserver/server/rest/services/NTM/MapServer/exts/LRServer/networkLayers/5/updateMeasuresFromLRS/?lrsDate=1539043200000&centerlineLayerId=8&inputLayerId=3&routeIdFieldName=ROUTEID&fromMeasureFieldName=FROMMEASURE&toMeasureFieldName=TOMEASURE&gdbVersion=sde.DEFAULT&sessionId=%7b1DBCA670-A0D2-48EA-AB9F-56E2DFB4E43B%7d&returnServiceEditsOption=originalAndCurrentFeatures&returnEditMoment=true&f=json

Example 2

URL for updating measures for selected features on the polyline feature layer:

https://sampleserver/server/rest/services/NTM/MapServer/exts/LRServer/networkLayers/5/updateMeasuresFromLRS/?lrsDate=1539043200000&centerlineLayerId=8&inputLayerId=3&inputLayerDefinition=%7b%22objectIds%22%3a%5b8%2c9%5d%7d&routeIdFieldName=ROUTEID&fromMeasureFieldName=FROMMEASURE&toMeasureFieldName=TOMEASURE&gdbVersion=sde.DEFAULT&sessionId=%7b1DBCA670-A0D2-48EA-AB9F-56E2DFB4E43B%7d&returnServiceEditsOption=originalAndCurrentFeatures&returnEditMoment=true&f=json

Example 3

URL for updating measures for features on the polyline feature layer that meet a definition query:

https://sampleserver/server/rest/services/NTM/MapServer/exts/LRServer/networkLayers/5/updateMeasuresFromLRS/?lrsDate=1539043200000&centerlineLayerId=8&inputLayerId=3&inputLayerDefinition=%7b%22where%22%3a%22%20(%20NAME%20IS%20NOT%20NULL%20)%22%7d&routeIdFieldName=ROUTEID&fromMeasureFieldName=FROMMEASURE&toMeasureFieldName=TOMEASURE&gdbVersion=sde.DEFAULT&sessionId=%7b1DBCA670-A0D2-48EA-AB9F-56E2DFB4E43B%7d&returnServiceEditsOption=originalAndCurrentFeatures&returnEditMoment=true&f=json

JSON Response syntax

Query this job URL to get progress updates and results of the operation.

{
    "statusURL": "<jobIdURL>"
}

JSON Response example

{
    "statusURL": "https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/jobs/j3c0a00b4314349eb8e4ff6ff7ac2db5d"
}