Append Routes

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

Description

This operation appends routes from an input polyline into an LRS Network.

Request parameters

ParameterDetails

f

(Optional)

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

Values: html | json | pjson

uploadItemId

The item ID of the uploaded source feature class. The item ID is generated when the source is uploaded to the server. The file geodatabase must be zipped before upload and must contain only one source feature class.

The following hierarchy must be maintained in the .zip archive:

Use dark colors for code blocksCopy
1
2
3
|--<filename>.zip
    |--<filename>.gdb
        |--Source feature class

Syntax:

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

Example:

Use dark colors for code blocksCopy
1
uploadItemId="idec5bf57-1649-44ce-bac1-19bd0872a026"

routeIdFieldName

The field in the input polyline feature class that will be mapped to the LRS Network route ID. The field type must match the RouteID field type of the target LRS Network and must either be a string or GUID field type. If it is a text field, the field length must be shorter than or equal to the length of the target RouteID field.

Syntax:

Use dark colors for code blocksCopy
1
routeIdFieldName="<field name>"

Example:

Use dark colors for code blocksCopy
1
routeIdFieldName="routeId"

routeNameFieldName

The field in the input polyline feature class that will be mapped as the LRS Network route name. The field must be a string field, and the field length must be shorter than or equal to the length of the target route name field.

Syntax:

Use dark colors for code blocksCopy
1
routeNameFieldName="<field name>"

Example:

Use dark colors for code blocksCopy
1
routeNameFieldName="routeName"

fromDateFieldName

A date field in the input polyline feature class that will be mapped as the LRS Network from date.

Syntax:

Use dark colors for code blocksCopy
1
fromDateFieldName="<field name>"

Example:

Use dark colors for code blocksCopy
1
fromDateFieldName="fromDate"

toDateFieldName

A date field in the input polyline feature class that will be mapped as the LRS Network to date.

Syntax:

Use dark colors for code blocksCopy
1
toDateFieldName="<field name>"

Example:

Use dark colors for code blocksCopy
1
toDateFieldName="toDate"

lineIdFieldName

(Optional)

The input polyline feature class that will be mapped as the LRS Network line ID. This parameter is only used if the target is an LRS line network. The field type must match the RouteID field type of the centerline sequence table and must either be a string of exactly 38 characters or a GUID field type.

Syntax:

Use dark colors for code blocksCopy
1
lineIdFieldName="<field name>"

Example:

Use dark colors for code blocksCopy
1
lineIdFieldName="lineId"

lineNameFieldName

(Optional)

The input polyline feature class that will be mapped as the LRS Network line ID. This parameter is only used if the target is an LRS line network. The field type must match the RouteID field type of the centerline sequence table and must either be a string of exactly 38 characters or a GUID field type.

Syntax:

Use dark colors for code blocksCopy
1
lineNameFieldName="<field name>"

Example:

Use dark colors for code blocksCopy
1
lineNameFieldName="lineName"

lineOrderFieldName

(Optional)

Long integer field in the input polyline feature class that will be mapped as the LRS Network line order. This parameter is only used if the target is an LRS line network.

Syntax:

Use dark colors for code blocksCopy
1
lineOrderFieldName="<field name>"

Example:

Use dark colors for code blocksCopy
1
lineOrderFieldName="lineOrder"

fieldMap

Controls how the attribute information in the fields of the source is transferred to the target layer.

Syntax:

Use dark colors for code blocksCopy
1
fieldMap=[{"sourceField":"<field name>","targetField":"<field name>"},{"sourceField":"<field name>","targetField":"<field name>"}, ...]

Example:

Use dark colors for code blocksCopy
1
fieldMap=[{"sourceField":"SourceFieldName1","targetField":"TargetFieldName1"},{"sourceField":"SourceFieldName1","targetField":"TargetFieldName1"}, ... ]

loadType

Specifies how appended routes with measure or temporality overlap with identical route IDs as target network records are loaded into the network feature class.

  • add—Appends the input routes into the target LRS Network.

  • retireByRouteId—Appends the input routes into the target LRS Network and retires any routes in the target LRS Network that have the same route ID and temporality overlap as the appended routes.

  • replaceByRouteId—Appends the input routes into the target LRS Network and deletes any routes in the target LRS Network with the same route ID as the appended routes.

Syntax:

Use dark colors for code blocksCopy
1
loadType=<type>

Values: add | retireByRouteId | replaceByRouteId

loadField

Specifies whether route ID or route name will be used as target network records are loaded into the network feature class. This parameter will be ignored and default to use routeId when the network does not support route name or the loadType value is retireByRouteId or replaceByRouteId.

  • routeId—Loads by the route ID field.

  • routeName—Loads by the route name field.

Syntax:

Use dark colors for code blocksCopy
1
loadField=<field>

Values: routeId | routeName

considerExistingCenterlines

(Optional)

Specifies whether routes will be appended using existing centerline or if new centerlines will be created for the appended routes. This value is set to false by default.

Syntax:

Use dark colors for code blocksCopy
1
considerExistingCenterlines="<value>"

Values: true | false

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=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=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=true is returned. If the server encounters an error when generating the list of edits in the response, exceededTransferLimit=true is also returned.

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

The following is a sample URL for adding route records:

URL for adding route records in the target network from the source feature class.

Use dark colors for code blocksCopy
1
https://sampleserver/server/rest/services/LRSService/MapServer/exts/LRServer/networkLayers/1/appendRoutes?returnServiceEditsOption=originalAndCurrentFeatures&returnEditMoment=true&uploadItemId=idec5bf57-1649-44ce-bac1-19bd0872a026&fieldMap=[{"sourceField":"SourceFieldName1","targetField":"TargetFieldName1"},{"sourceField":"SourceFieldName1","targetField":"TargetFieldName1"}]&loadType=add&loadField=routeId&considerExistingCenterlines=false&routeIdFieldName=ROUTEID&routeNameFieldName=ROUTENAME&fromDateFieldName=FROMDATE&toDateFieldName=TODATE&lineIdFieldName=LINEID&lineNameFieldName=LINENAME&lineOrderFieldName=ORDERID&f=json&gdbVersion=sde.DEFAULT&sessionId={FA6E2656-AD4E-4FDD-A484-80479C53F231}

JSON Response syntax

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

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

JSON Response example

The following is an example of a successful response:

Use dark colors for code blocksCopy
1
2
3
{
  "statusURL": "https://sampleserver/arcgis/rest/services/LRSService/MapServer/exts/LRServer/jobs/j1e84dac5934d44c4a52d0b6d4b22de09"
}

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