Skip To Content
ArcGIS Developers
Dashboard

Query

Description

The query operation queries the locatability of the provided set of objects and optionally synthesizes geometry to be returned for each object in a geometry bag as a collection of points and polylines.

Request parameters

ParameterDetails
f

Description: Optional parameter specifying the output format of the response. The default response format is html.

Values: html | json

gdbVersion

Description: Optional parameter specifying the name of the geodatabase version. The default is DEFAULT.

Syntax: gdbVersion=<version>

sessionId

Description: Optional parameter specifying the token (guid) used to lock the version. If a client has previously started an edit session and holds an exclusive lock on the version specified, the request will fail if the sessionId is not provided. If the specified version is currently locked by any other session, the request will fail if the sessionId is not provided or does not match the sessionId that holds the exclusive lock.

Syntax: sessionId=<guid>

moment

Description: Optional parameter specifying the session moment. The default is the current version moment. This should only be specified by the client when you do not want to use the current moment.

Syntax: moment=<Epoch time in milliseconds>

maxGeometryCount

Description: The maximum number of geometries that can be synthesized and returned in the result.

objects

Description: The set of objects for which to get locatability and synthesize the geometries.

Syntax :

[ 
{ 
  “sourceId” : <long>, 
  “globalIds” : [<guid>] 
  } 
]

attachmentAssociations

Description: Optional Boolean parameter specifying whether to synthesize the geometry representing the structural attachment associations. The default is false.

Values: <true | false>

connectivityAssociations

Description: Optional Boolean parameter specifying whether to synthesize the geometry representing the connectivity associations. The default is false.

Values: <true | false>

containmentAssociations

Description: Optional Boolean parameter specifying whether to synthesize the geometry representing the containment associations. The default is false.

Values: <true | false>

locations

Description: Optional Boolean parameter specifying whether to synthesize the geometry representing the derived location of the object. This option only affects results when objects are features or nonspatial objects. The default is false.

Values: <true | false>

outSR

Description: Optional parameter specifying the output spatial reference.

Syntax: outSR=<wkid>

JSON Response syntax

{ 
  “exceededTransferLimit" : <boolean>, 
  “objects” : 
    { 
      “sourceID” : <long>, 
      “globalId” : <guid>, 
      “isLocatable” : <boolean>, 
      “geometry” : <geometry>   // optional 
    }
  ], 

  “associations” : [ 

    { 
      “globalId” : <guid>, 
      “associationType” : “attachment” | “connectivity” | “containment” | "junctionEdgeFromConnectivity" | "junctionEdgeMidspanConnectivity" | "junctionEdgeToConnectivity", 
      “fromNetworkSourceId” : <long>, 
      “fromGlobalId” : <guid>, 
      “fromTerminalId” : <long>, 
      “toNetworkSourceId” : <long>, 
      “toGlobalId” : <guid>, 
      “toTerminalId” : <long>, 
      “geometry” : <geometry> 

    } 
  ], 
  “success” : <boolean>, 
  “error” : {                   // only if success is false 
    “extendedCode” : <HRESULT>, 
    “message” : <string>, 
    “details” : [ <string> ] 
} 
}

Example usage

Synthesize the geometries of a feature or nonspatial object using the query operation.

https://myserver.esri.com/server/rest/services/LandUse/UtilityNetworkServer/locations/query

maxGeometryCount=100
objects=[{"sourceId":16,"globalIds":["{A1094F84-42E3-4179-9236-51E1351054F8}"]}]
locations=true

JSON response:

{
	"exceededTransferLimit": false,
	"objects": [
		{
			"sourceId": 16,
			"globalId": "{A1094F84-42E3-4179-9236-51E1351054F8}",
			"isLocatable": true,
			"geometry": {
				"geometries": [
					{
						"x": 477998.4096999997,
						"y": 3629397.339299999,
						"z": 0,
						"m": null
					}
				]
			}
		}
	],
	"associations": [],
	"success": true
}

Synthesize the geometries of associations using the query operation.

https://myserver.esri.com/server/rest/services/LandUse/UtilityNetworkServer/locations/query

maxGeometryCount=100
objects=[{"sourceId":16,"globalIds":["{D103F8F1-B186-4442-82F7-29C58C281DA9}","{04D36A29-5B27-4357-A40F-176938EA7596}"]}]
attachmentAssociations=true
connectivityAssociations=true
containmentAssociations=true
{
	"exceededTransferLimit": false,
	"objects": [],
	"associations": [
		{
			"globalId": "{D103F8F1-B186-4442-82F7-29C58C281DA9}",
			"fromNetworkSourceId": 4,
			"fromGlobalId": "{7B2BE9B5-2A45-46A5-B84E-6D215B268D01}",
			"fromTerminalId": 0,
			"toNetworkSourceId": 16,
			"toGlobalId": "{1C84C796-F17B-4C8E-8EE2-B8809E0BA600}",
			"toTerminalId": 0,
			"associationType": "containment",
			"geometry": {
				"geometries": [
					{
						"x": 477693.67980000007,
						"y": 3630324.6500000006,
						"z": 0,
						"m": null
					},
					{
						"x": 477656.47869999989,
						"y": 3630391.6119,
						"z": 0,
						"m": null
					}
				]
			}
		},
		{
			"globalId": "{04D36A29-5B27-4357-A40F-176938EA7596}",
			"fromNetworkSourceId": 16,
			"fromGlobalId": "{63FA7869-1656-4732-9608-0D2BDA861A18}",
			"fromTerminalId": 1,
			"toNetworkSourceId": 19,
			"toGlobalId": "{699A8BE7-F151-4599-8627-7B51E6B41EBD}",
			"toTerminalId": 1,
			"associationType": "connectivity",
			"geometry": {
				"geometries": [
					{
						"x": 476946.67459999959,
						"y": 3629962.1516999995,
						"z": 0,
						"m": null
					},
					{
						"x": 476955.1387,
						"y": 3629930.6654000005,
						"z": 0,
						"m": null
					}
				]
			}
		}
	],
	"success": true
}