Skip To Content
ArcGIS Developer
Dashboard

Query Attribute Set

Description

License:

The ArcGIS Location Referencing license is required to use this resource.

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 parameter to specify the response format. The default response format is html.

Values: html | json

locations

Required

Description: 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:

[
  { // syntax of a single measure
    "routeId" : "<routeId1>",
    "measure" : <measure1>
  },
  {
    "routeId" : "<routeId1>",
    "measure" : <measure2>
  }
  ...
]

or

[
  { // syntax of a measure range
    "routeId" : "<routeId1>",
    "fromMeasure" : <measure1>,
    "toMeasure" : <measure2>
  },
  {
    "routeId" : "<routeId1>",
    "fromMeasure" : <measure3>,
    "toMeasure" : <measure4>
  }
  ...
]

or

[
  { // syntax to return the entire route
    "routeId" : "<routeId1>"
  },
  {
    "routeId" : "<routeId2>"
  }
  ...
]
attributeSet

Description: 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 for use with an LRS using the Configure Utility Network Feature Class geoprocessing tool. 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.

Syntax:

[
  {
    "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.

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

Syntax: temporalViewDate=<timeInstant>

Example: 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 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

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

Syntax: historicMoment=<epoch time in milliseconds>

Example: historicMoment=1514764800000

This parameter was added at 10.6.1.

Example usage

Example 1

URL for segmenting a linear event layer with single measures.

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.

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.

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.

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.

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.

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

{  // 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" : <spatialReference>,
  "features" : [
    {
      "geometry" : <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

{
  "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" : <spatialReference>,
  "features" : [
    {
      "geometry" : <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

{
  "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

{
  "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",
          ...
        ]
      }
    },
    ...
  ]
}