Derive Event Measures

URL:
https://<network-layer-url>/deriveEventMeasures
Methods:
GET
Required Capability:
The ArcGIS Location Referencing license is required to use this resource.
Version Introduced:
10.7

Description

This operation populates and updates the derived route ID and measure values on point and line events with those fields configured and enabled.

Editing is supported only for multiuser (enterprise and workgroup) geodatabases. File and personal geodatabases do not support web editing.

Request parameters

ParameterDetails

f

(Optional)

Specifies the response format. The default response format is html.

Values: html | json | pjson

updateAllEvents

(Optional)

Specifies whether all event feature classes in the network will be updated. The default is false. Values: true | false

eventLayerIds

(Required)

Specifies a list of event layer IDs that will be updated when updateAllEvents is set to false. This is ignored when updateAllEvents is set to true.

layerDefinitions

(Optional)

Contains a list of Object IDs, a SQL WHERE clause, and a time instant defining the routes on which the operation will be performed for each specified layer. Syntax:

Use dark colors for code blocksCopy
1
2
3
4
5
{
  "objectIds": [1,2,3,4,5],
  "where": "lineName in ('MainA', 'MainB', 'MainC')",
  "time": [1200045, 1200100]
}

For time, a single value can be provided. For example, time instant can be an input or a pair of values representing start and end time.

gdbVersion

(Optional)

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

Syntax:

Use dark colors for code blocksCopy
1
gdbVersion=<version>

Example:

Use dark colors for code blocksCopy
1
gdbVersion="user1.version1"

sessionId

(Optional)

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

Syntax:

Use dark colors for code blocksCopy
1
sessionId=<guid>

Example:

Use dark colors for code blocksCopy
1
sessionId="{E81C2E2D-C6A7-40CB-BF61-FB499E53DD1D}"

returnEditMoment

(Optional)

Specifies whether the response reports the time edits that were applied. If returnEditMoment is set to true, the server returns the time edits that were applied in the response's editMoment key. The default value is false.

Values: true | false

returnServiceEditsOption

(Optional)

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 from the geodatabase. If returnServiceEditsOption is set to originalAndCurrentFeatures, the deleted destination feature is returned along with a reference to the deleted original feature in the response. Note that, even for deletions, the geometry and attributes of the edited feature are returned.

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

Service-level applyEdits response structure:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[
  {
    id
    addResults
    updateResults
    deleteResults
    attachments: {
      addResults
      updateReults
      deleteResults
    }
    editMoment
    editedFeatures
    exceededTransferLimit
  },
  {
  ...
  }
]

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

editedFeatures response structure:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
{
  "editedFeatures": [
    {
      "adds": [ <feature1>, <feature2>], 	// current features
      "updates": [[<originalFeature3>, < currentFeature3>], [<originalFeature4>, < currentFeature4>]],
      "deletes": [ <feature5>, <feature6>]	// original features
    },
  ]
}

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

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

The default value is none, which does not include editedFeatures values.

Values: none | originalAndCurrentFeatures

Example usage

Example 1

URL to update all events.

Use dark colors for code blocksCopy
1
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/6/deriveEventMeasures?updateAllEvents=true&layerDefinition=&gdbVersion=sde.version1&sessionId=%7B1CC754B0-08B2-49B9-80E5-1481C3CA2871%7D&f=json

Example 2

URL to update the events based on the specified event layer IDs and layer definitions.

Use dark colors for code blocksCopy
1
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/6/deriveEventMeasures?updateAllEvents=false&eventLayerIds[2,3]&layerDefinitions= [{“id”:3,”layerDefinition”:{"where":"LINEID='MainLine'"}}]&gdbVersion=sde.version1&sessionId=%7B1CC754B0-08B2-49B9-80E5-1481C3CA2871%7D&f=json

JSON response syntax

Use dark colors for code blocksCopy
1
2
3
{
  "statusURL": <jobIdURL>
}

JSON response example

Use dark colors for code blocksCopy
1
{"statusURL":"https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/jobs/j3c0a00b4314349eb8e4ff6ff7ac2db5d"}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.