Query Attribute Set

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

Description

This operation segments event layers for selected routes where any measures change across the attribute set based on different measures or measure ranges. The result of this operation is a feature set that contains the values for the fields included in an attribute set and some additional fields that contain the route ID and measures from the network on which the query is performed. The geometry of each feature is also returned in the feature set.

Request parameters

ParameterDetails

f

(Optional)

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

Values: html | json | pjson

locations

(Required)

A list of routes and measure values used to segment event layers. The list can be either all single measures or all measure ranges; it can't mix single measures and measure ranges. Each route can have one or more different measures. If only a routeId is provided, the entire route is returned.

Syntax:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
[
  { // syntax of a single measure
    "routeId": "<routeId1>",
    "measure": <measure1>
  },
  {
    "routeId": "<routeId1>",
    "measure": <measure2>
  }
  ...
]

or

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
[
  { // syntax of a measure range
    "routeId": "<routeId1>",
    "fromMeasure": <measure1>,
    "toMeasure": <measure2>
  },
  {
    "routeId": "<routeId1>",
    "fromMeasure": <measure3>,
    "toMeasure": <measure4>
  }
  ...
]

or

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
[
  { // syntax to return the entire route
    "routeId": "<routeId1>"
  },
  {
    "routeId": "<routeId2>"
  }
  ...
]

attributeSet

An attribute set that contains the linear event layers to query and fields to include in the result. The linear event layer can also be a Utility Network pipeline layer that has been configured as an LRS centerline using the Configure Utility Network Feature Class geoprocessing tool, or an address block range layer that has been configured as an LRS centerline using the Configure Address Feature Classes geoprocessing tool. When the centerline layer is an Address feature, the centerline direction is honored in the output. The object ID field for each layer specified will always be included in the results. If a field name already exists across all layers, it is renamed.

If the input layer has address range fields from an Address Data Management configuration, and is configured as an address feature class in an LRS, the values in the address range fields will be updated for each segment in the output.

Syntax:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
[
  {
    "layerId" : "<layerId1>",
    "fields" : [ "<field1>", "<field2>", "<field3>", ... ]
  },
  {
    "layerId" : "<layerId2>",
    "fields" : [ "<field1>", "<field2>", ... ]
  },
  ...
]

temporalViewDate

The time instant to use as a temporal view date when locating route features. If this parameter is not specified, the current date is used.

The parameter value is a number that represents the number of milliseconds since epoch (January 1, 1970) in UTC.

Syntax:

Use dark colors for code blocksCopy
1
temporalViewDate=<timeInstant>

Example:

Use dark colors for code blocksCopy
1
temporalViewDate=1230768000000 (1 Jan 2009 00:00:00 GMT)

outSR

The spatial reference of the returned geometry.

The spatial reference can be specified as either a Well-Known ID (WKID) or a spatial reference JSON object.

If outSR is not specified, the geometry is returned in the spatial reference of the map service.

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

Example 1

URL for segmenting a linear event layer with single measures.

Use dark colors for code blocksCopy
1
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/0/queryAttributeSet?f=json&locations=\[{'{'}"routeId":"I90","measure":25{'}'}]&attributeSet=\[{'{'}"layerId":1,"fields":\["aadt"]{'}'}]&outSR=102100

Example 2

URL for segmenting a linear event layer with a measure range.

Use dark colors for code blocksCopy
1
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/0/queryAttributeSet?f=json&locations=\[{'{'}"routeId":"I90","fromMeasure":25.1,"toMeasure":26.8{'}'}]&attributeSet=\[{'{'}"layerId":1,"fields":\["aadt"]{'}'}]&outSR=102100

Example 3

URL for segmenting a linear event layer with different routes and measures.

Use dark colors for code blocksCopy
1
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/0/queryAttributeSet?f=json&locations=\[{'{'}"routeId":"I90","measure":25.0{'}'},{'{'}"routeId":"US20","measure":72.6{'}'}]&attributeSet=\[{'{'}"layerId":1,"fields":\["aadt"]{'}'}]&outSR=102100

Example 4

URL for segmenting a linear event layer with different measure ranges.

Use dark colors for code blocksCopy
1
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/0/queryAttributeSet?f=json&locations=\[{'{'}"routeId":"I90","fromMeasure":25.1,"toMeasure":26.8{'}'},{'{'}"routeId":"I90","fromMeasure":72.6,"toMeasure":80.5]&attributeSet=\[{'{'}"layerId":1,"fields":\["aadt"]{'}'}]&outSR=102100

Example 5

URL for segmenting multiple linear event layers with different routes and measure ranges.

Use dark colors for code blocksCopy
1
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/0/queryAttributeSet?f=json&locations=\[{'{'}"routeId":"I90","fromMeasure":25.1,"toMeasure":26.8{'}'},{'{'}"routeId":"US20","fromMeasure":72.6,"toMeasure":80.5]&attributeSet=\[{'{'}"layerId":1,"fields":\["aadt"]{'}'},{'{'}"layerId":2,"fields":\["functional_class"]{'}'}]&outSR=102100

Example 6

URL for segmenting a linear event layer for the entire route.

Use dark colors for code blocksCopy
1
https://sampleserver/arcgis/rest/services/MyLRS/MapServer/exts/LRServer/networkLayers/0/queryAttributeSet?f=json&locations=\[{'{'}"routeId":"I90"{'}'},{'{'}“routeId”:”US20”{'}'}]&attributeSet=\[{'{'}"layerId":1,"fields":\["aadt"]{'}'}]&outSR=102100

JSON Response syntax

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
{  // display field name will always be route_id which is the route ID specified in the locations
  "displayFieldName": "route_id",
  "fieldAliases": {  // field aliases will include route_id, from_measure, and to_measure when segmenting by measure ranges
    "route_id": "Route ID",
    "route_name": "Route Name",  // included when the network layer has a route name field
    "line_id": "Line ID",  // included when the network layer supports lines
    "line_name": "Line Name",  // included when the network layer supports lines
    "line_order": "Line Order",  // included when the network layer supports lines
    "from_measure": "From Measure",
    "to_measure": "To Measure",
    "<fieldName1>": "<fieldAlias1>",
    "<objectIdFieldName1>": "<objectIdFieldAlias1>",
    "<routeIdFieldName1>": "<routeIdFieldAlias1>",
    "<fieldName2>": "<fieldAlias2>",
    "<objectIdFieldName2>": "<objectIdFieldAlias2>",
    "<routeIdFieldName2>": "<routeIdFieldAlias2>",
    ...
  },
  "fields": [  // fields will include route_id, from_measure, and to_measure when segmenting by measure ranges
    {"name": "route_id", "type": "esriFieldTypeString", "alias": "Route ID"},
    {"name": "route_name", "type": "esriFieldTypeString", "alias": "Route Name"},  // included when the network layer has a route name field
    {"name": "line_id", "type": "esriFieldTypeString", "alias": "Line ID"},  // included when the network layer supports lines
    {"name": "line_name", "type": "esriFieldTypeString", "alias": "Line Name"},  // included when the network layer supports lines
    {"name": "line_order", "type": "esriFieldTypeInteger", "alias": "Line Order"},  // included when the network layer supports lines
    {"name": "from_measure", "type": "esriFieldTypeDouble", "alias": "From Measure"},
    {"name": "to_measure", "type": "esriFieldTypeDouble", "alias": "To Measure"},
    {"name": "<fieldName1>", "type": "<fieldType1>", "alias": "<fieldAlias1>", "length": "<length1>"},
    {"name": "<objectIdFieldName1>", "type": "esriFieldTypeOID", "alias" : "<objectIdFieldAlias1>"},
    {"name": "<routeIdFieldName1>", "type": "esriFieldTypeArray", "alias" : "<routeIdFieldAlias1>"},
    {"name": "<fieldName2>", "type": "<fieldType2>", "alias": "<fieldAlias2>", "length": "<length2>"},
    {"name": "<objectIdFieldName2>", "type": "esriFieldTypeOID", "alias": "<objectIdFieldAlias2>"},
    {"name": "<routeIdFieldName2>", "type": "esriFieldTypeArray", "alias": "<routeIdFieldAlias2>"},
    ...
  ],
  // locations input containing measure ranges will always return polyline geometry type
  "geometryType": "esriGeometryPolyline",
  "spatialReference": <>,
  "features": [
    {
      "geometry": <>,
      "attributes": {
        "route_id": "<routeId>",
        "route_name": "<routeName>",
        "line_id": "<lineId>",
        "line_name": "<lineName>",
        "line_order": "<lineOrder>",
        "from_measure": <measure1>,
        "to_measure": <measure2>,
        "fieldName1": <value1>,
        "objectIdFieldName1": <objectId1>,
        "routeIdFieldName1": [
          "<routeId1>",
          ...
        ],
        "fieldName2": <value2>,
        "objectIdFieldName2": <objectId2>,
        "routeIdFieldName2": [
          "<routeId2>",
          ...
        ],
        ...
      }
    },
    ...
  ]
}

or

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
{
  "displayFieldName": "route_id",
  "fieldAliases": {  // field aliases will include route_id and measure when segmenting by single measures
    "route_id": "Route ID",
    "route_name": "Route Name",  // included when the network layer has a route name field
    "line_id": "Line ID",  // included when the network layer supports lines
    "line_name": "Line Name",  // included when the network layer supports lines
    "line_order": "Line Order",  // included when the network layer supports lines
    "measure": "Measure",
    "<fieldName1>": "<fieldAlias1>",
    "<objectIdFieldName1>": "<objectIdFieldAlias1>",
    "<routeIdFieldName1>": "<routeIdFieldAlias1>",
    "<fieldName2>": "<fieldAlias2>",
    "<objectIdFieldName2>": "<objectIdFieldAlias2>",
    "<routeIdFieldName2>": "<routeIdFieldAlias2>",
    ...
  },
  "fields": [  // fields will include route_id and measure when segmenting by single measures
    {"name": "route_id", "type": "esriFieldTypeString", "alias": "Route ID"},
    {"name": "route_name", "type": "esriFieldTypeString", "alias": "Route Name"},  // included when the network layer has a route name field
    {"name": "line_id", "type": "esriFieldTypeString", "alias": "Line ID"},  // included when the network layer supports lines
    {"name": "line_name", "type": "esriFieldTypeString", "alias": "Line Name"},  // included when the network layer supports lines
    {"name": "line_order", "type": "esriFieldTypeInteger", "alias": "Line Order"},  // included when the network layer supports lines
    {"name": "measure", "type": "esriFieldTypeDouble", "alias": "Measure"},
    {"name": "<fieldName1>", "type": "<fieldType1>", "alias": "<fieldAlias1>", "length": "<length1>"},
    {"name": "<objectIdFieldName1>", "type": "esriFieldTypeOID", "alias": "<objectIdFieldAlias1>"},
    {"name": "<routeIdFieldName1>", "type": "esriFieldTypeArray", "alias": "<routeIdFieldAlias1>"},
    {"name": "<fieldName2>", "type": "<fieldType2>", "alias": "<fieldAlias2>", "length": "<length2>"},
    {"name": "<objectIdFieldName2>", "type": "esriFieldTypeOID", "alias": "<objectIdFieldAlias2>"},
    {"name": "<routeIdFieldName2>", "type": "esriFieldTypeArray", "alias": "<routeIdFieldAlias2>"},
    ...
  ],
  // locations input containing single measures will always return point geometry type
  "geometryType": "esriGeometryPoint",
  "spatialReference": <>,
  "features": [
    {
      "geometry": <>,
      "attributes": {
        "route_id": "<routeId>",
        "route_name": "<routeName>",
        "line_id": "<lineId>",
        "line_name": "<lineName>",
        "line_order": "<lineOrder>",
        "measure": <measure>,
        "fieldName1": <value1>,
        "objectIdFieldName1": <objectId1>,
        "routeIdFieldName1": [
          "<routeId1>",
          ...
        ],
        "fieldName2": <value2>,
        "objectIdFieldName2": <objectId2>,
        "routeIdFieldName2": [
          "<routeId2>",
          ...
        ],
        ...
      }
    },
    ...
  ]
}

JSON Response example

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
{
  "displayFieldName": "route_id",
  "fieldAliases": {
    "route_id": "Route ID",
    "from_measure": "From Measure",
    "to_measure": "To Measure",
    "aadt": "AADT",
    "OBJECTID": "OBJECT ID",
    // field name is renamed from route_id to route_id_1 because same name already exists.
    "route_id_1": "Route ID",
    "functional_class": "Functional Class",
    // field name is renamed from OBJECTID to OBJECTID_1 because same name already exists.
    "OBJECTID_1": "OBJECT ID",
    "route_id_2": "Route ID"
  },
  "fields": [
    { "name": "route_id", "type": "esriFieldTypeString", "alias": "Route ID" },
    { "name": "from_measure", "type": "esriFieldTypeDouble", "alias": "From Measure" },
    { "name": "to_measure", "type": "esriFieldTypeDouble", "alias": "To Measure" },
    { "name": "aadt", "type": "esriFieldTypeSmallInteger", "alias": "AADT" },
    { "name": "OBJECTID", "type": "esriFieldTypeOID", "alias": "OBJECT ID" },
    // field name is renamed from route_id to route_id_1 because same name already exists.
    { "name": "route_id_1", "type": "esriFieldTypeArray", "alias": "Route ID" },
    { "name": "functional_class", "type": "esriFieldTypeSmallInteger", "alias": "Functional Class" },
    // field name is renamed from OBJECTID to OBJECTID_1 because same name already exists.
    { "name": "OBJECTID_1", "type": "esriFieldTypeOID", "alias": "OBJECT ID" },
    { "name": "route_id_2", "type": "esriFieldTypeArray", "alias": "Route ID" }
  ],
  "geometryType": "esriGeometryPolyline",
  "spatialReference": { "wkid": 102100 },
  "features": [
    {
      "geometry": {
        "hasM": true,
        "hasZ: true,
        "paths": [
          [ [-8704419.30801353,5352063.51512939,0,-0.000100005767308176], [-8704419.49135205,5352063.63401411,0,0] ]
        ]
      },
      "attributes": {
        "route_id": "I90",
        "from_measure": 25.1,
        "to_measure": 26.8,
        "aadt": 1,
        "OBJECTID": 19568,
        "route_id_1": [
          "01100545",
          ...
        ],
        "functional_class": 2,
        "OBJECTID_1": 16400,
        "route_id_2": [
          "01100503",
          ...
        ]
      }
    },
    ...
  ]
}

or

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
{
  "displayFieldName": "route_id",
  "fieldAliases": {
    "route_id": "Route ID",
    "measure": "Measure",
    "aadt": "AADT",
    "OBJECTID": "OBJECT ID",
    // field name is renamed from route_id to route_id_1 because same name already exists.
    "route_id_1": "Route ID",
    "functional_class": "Functional Class",
    // field name is renamed from OBJECTID to OBJECTID_1 because same name already exists.
    "OBJECTID_1": "OBJECT ID",
    "route_id_2": "Route ID"
  },
  "fields": [
    { "name": "route_id", "type": "esriFieldTypeString", "alias": "Route ID" },
    { "name": "measure", "type": "esriFieldTypeDouble", "alias": "Measure" },
    { "name": "aadt", "type": "esriFieldTypeSmallInteger", "alias": "AADT" },
    { "name": "OBJECTID", "type": "esriFieldTypeOID", "alias": "OBJECT ID" },
    // field name is renamed from route_id to route_id_1 because same name already exists.
    { "name": "route_id_1", "type": "esriFieldTypeArray", "alias": "Route ID" },
    { "name": "functional_class", "type": "esriFieldTypeSmallInteger", "alias": "Functional Class" },
    // field name is renamed from OBJECTID to OBJECTID_1 because same name already exists.
    { "name": "OBJECTID_1", "type": "esriFieldTypeOID", "alias": "OBJECT ID" },
    { "name": "route_id_2", "type": "esriFieldTypeArray", "alias": "Route ID" }
  ],
  "geometryType": "esriGeometryPoint",
  "spatialReference": { "wkid": 102100 },
  "features": [
    {
      "geometry": {
        "m": 4.92497602
        "x": -8710014.12890288,
        "y": 5360361.60842177,
        "z": 0
      },
      "attributes": {
        "route_id": "I90",
        "measure": 25.1,
        "aadt": 1,
        "OBJECTID": 19568,
        "route_id_1": [
          "01100545",
          ...
        ],
        "functional_class": 2,
        "OBJECTID_1": 16400,
        "route_id_2": [
          "01100503",
          ...
        ]
      }
    },
    ...
  ]
}

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