Query Route Associations

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

Description

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

(Optional)

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

Values: html | json | pjson

centerlineIds

(Optional)

Specifies an array of input centerline IDs.

Syntax:

Use dark colors for code blocksCopy
1
centerlineIds=["<centerlineGuid1>", "<centerlineGuid2>", ...]

Example:

Use dark colors for code blocksCopy
1
centerlineIds=["{124EF4E1-D6D7-47CD-A993-6E036584742C}", "{7BC4E070-CD40-40B0-8F13-75C75B3A80CF}"]

centerlineObjectIds

(Optional)

Specifies an array of input centerline Object IDs.

Syntax:

Use dark colors for code blocksCopy
1
centerlineObjectIds=[<centerlineOid1>, <centerlineOid2>, ...]

Example:

Use dark colors for code blocksCopy
1
centerlineObjectIds=[150, 250]

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"

historicMoment

(Optional)

Specifies 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 applies to the current features.

Syntax:

Use dark colors for code blocksCopy
1
historicMoment=<epoch time in milliseconds>

Example:

Use dark colors for code blocksCopy
1
historicMoment=1514764800000

Example usage

The following URLs demonstrate how to query route associations using centerline attributes.

Example 1

A query with only centerline Object IDs:

Use dark colors for code blocksCopy
1
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:

Use dark colors for code blocksCopy
1
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:

Use dark colors for code blocksCopy
1
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.

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
20
21
22
23
24
25
26
{
  "associations": [
    {
      "centerlineId": "<centerlineGuid>",
      "centerlineObjectId": "<centerlineOid>",
      "networks": [
        {
          "lrsNetworkId": "<networkId>",
          "networkLayerId": "<networkLayerId>",
          "lrsNetworkName": "<networkName>",
          "routes": [
            {
              "routeId": "<routeId>",
              "lineId": "<lineId>",
              "fromDate": "<epochTimeInMilliseconds>",
              "toDate": "<epochTimeInMilliseconds>"
            },
            ...
          ]
        },
        ...
      ]
    },
    ...
  ]
}

JSON Response example

The following is a response to the third example usage. Common centerline IDs and Object IDs in the input are merged into one associations object.

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
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
  "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
            }
          ]
        }
      ]
    }
  ]
}

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