ArcGIS REST API

Query Route Associations

Description

License:

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

This operation finds route records across all networks that are associated with the input centerlines. It returns valid associations for records that are present in both the centerline sequence and network tables and are overlapping in their time spans.

Request Parameters

ParameterDetails
f

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

Values: html | json

centerlineIds

Optional parameter to specify an array of input centerline Object IDs.

Syntax: centerlineObjectIds=[<centerlineOid1>, <centerlineOid2>, ...]

Example: centerlineObjectIds=[150, 250]

centerlineObjectIds

Optional parameter to specify an array of input centerline Object IDs.

Syntax: centerlineObjectIds=[<centerlineOid1>, <centerlineOid2>, ...]

Example: centerlineObjectIds=[150, 250]

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"

historicMoment

Description: Optional parameter to specify the historic moment to query. This parameter applies only if the layer is branch versioned and refers to geodatabase time (separate from LRS time).

If this parameter is not specified, the query will apply to the current features.

Syntax: historicMoment=<epoch time in milliseconds>

Example: historicMoment=1514764800000

Example Usage

Example 1

A query with only centerline Object IDs:

https://sampleserver/server/rest/services/MyLRS/MapServer/exts/LRServer/centerlineLayers/4/queryRouteAssociations?centerlineIds=&centerlineObjectIds=[0,1]&gdbVersion=SDE.default&historicMoment=&f=json

Example 2

A query with only centerline ID:

https://sampleserver/server/rest/services/MyLRS/MapServer/exts/LRServer/centerlineLayers/4/queryRouteAssociations?centerlineIds=["{0C9963C9-4F34-4363-A369-E9D8E56D0142}"]&centerlineObjectIds=&gdbVersion=SDE.default&historicMoment=&f=json

Example 3

A query with both centerline ID and Object IDs:

https://sampleserver/server/rest/services/MyLRS/MapServer/exts/LRServer/centerlineLayers/4/queryRouteAssociations?centerlineIds=["{0C9963C9-4F34-4363-A369-E9D8E56D0142}"]&centerlineObjectIds=[0,1]&gdbVersion=SDE.default&historicMoment=&f=json

JSON Response Syntax

Each object in the associations array refers to a unique centerline. Each object in the networks array refers to a unique network. Each object in the routes array refers to a unique route.

For associations where the network is not present in the service, networkLayerId will be set to -1. The lineId parameter will be populated for routes in engineering networks, and otherwise, they will be set to empty strings.

{
    "associations": [
        {
            "centerlineId": "<centerlineGuid>",
            "centerlineObjectId": <centerlineOid>,
            "networks": [
                {
                    "lrsNetworkId": <networkId>,
                    "networkLayerId": <networkLayerId>,
                    "lrsNetworkName": "<networkName>",
                    "routes": [
                        {
                            "routeId": "<routeId>",
                            "lineId": "<lineId>",
                            "fromDate": <epochTimeInMilliseconds>,
                            "toDate": <epochTimeInMilliseconds>
                        }, ...
                    ]
                }, ...
            ]
        }, ...
    ]
}

JSON Response Example

Consider this as a response to the third example usage. Common centerline IDs and Object IDs in the input are merged into one associations object.

{
    "associations": [
        {
            "centerlineId": "{0C9963C9-4F34-4363-A369-E9D8E56D0142}",
            "centerlineObjectId": 0,
            "networks": [
                {
                    "lrsNetworkId": 2,
                    "networkLayerId": 1,
                    "lrsNetworkName": "Continuous",
                    "routes": [
                        {
                            "routeId": "R1",
                            "lineId": "",
                            "fromDate": 1505429729000,
                            "toDate": null
                        }
                    ]
                },
                {
                    "lrsNetworkId": 1,
                    "networkLayerId": 2,
                    "lrsNetworkName": "Engineering",
                    "routes": [
                        {
                            "routeId": "R2",
                            "lineId": "L1",
                            "fromDate": 1535429729000,
                            "toDate": null
                        },
                        {
                            "routeId": "R3",
                            "lineId": "L2",
                            "fromDate": 1494434529000,
                            "toDate": 1713292129000
                        }
                    ]
                }
            ]
        },
        {
            "centerlineId": "{DE3A5E8C-EAC6-4916-BA56-CC6484257F59}",
            "centerlineObjectId": 1,
            "networks": [
                {
                    "lrsNetworkId": 2,
                    "networkLayerId": 1,
                    "lrsNetworkName": "Continuous",
                    "routes": [
                        {
                            "routeId": "R4",
                            "lineId": "",
                            "fromDate": 1505428029000,
                            "toDate": 1605428029000
                        },
                        {
                            "routeId": "R5",
                            "lineId": "",
                            "fromDate": 1484434529000,
                            "toDate": 1513292129000
                        }
                    ]
                }
            ]
        }
    ]
}