Query

URL:
https://<root>/<serviceName>/UtilityNetworkServer/locations/query
Methods:
GETPOST
Version Introduced:
10.9

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

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

Use dark colors for code blocksCopy
1
f=html | json | pjson

gdbVersion

(Optional)

Specifies the name of the geodatabase version. The default is 'sde.DEFAULT'.

Syntax: gdbVersion=<version>

sessionId

(Optional)

Specifies 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

(Optional)

Specifies 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>

Example: moment=1720456842

maxGeometryCount

(Required)

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

objects

(Required)

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

Syntax :

Use dark colors for code blocksCopy
1
2
3
4
5
6
[
{
  “sourceId” : <long>,
  “globalIds” : [<guid>]
  }
]

attachmentAssociations

(Optional)

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

Use dark colors for code blocksCopy
1
attachmentAssociations=true | false

connectivityAssociations

(Optional)

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

Use dark colors for code blocksCopy
1
connectivityAssociations=true | false

containmentAssociations

(Optional)

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

Use dark colors for code blocksCopy
1
containmentAssociations=true | false

locations

(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.

Use dark colors for code blocksCopy
1
locations=true | false

outSR

(Optional)

Introduced at ArcGIS Enterprise 11.1. Specifies the output spatial reference.

Syntax: outSR=<wkid>

async

(Optional)

Introduced at ArcGIS Enterprise 10.9.1. If true, the request is processed as an asynchronous job, and a URL is returned that a client can visit to check the status of the job. The default is false.

Use dark colors for code blocksCopy
1
async=true | false

JSON Response syntax

JSON response (when async = false):

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
{
  “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> ]
}
}

JSON response (when async = true):

Use dark colors for code blocksCopy
1
2
3
{
  "statusUrl" : <url>
}

JSON response to the status URL (when pending or in progress):

Use dark colors for code blocksCopy
1
2
3
4
5
{
  "status" : "<Pending | InProgress>",
  "submissionTime" : <datetime>,
  "lastUpdatedTime" : <datetime>
 }

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

Use dark colors for code blocksCopy
1
2
3
4
maxGeometryCount=100
objects=[{"sourceId":16,"globalIds":["{A1094F84-42E3-4179-9236-51E1351054F8}"]}]
locations=true
async=false

JSON response:

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

Use dark colors for code blocksCopy
1
2
3
4
5
maxGeometryCount=100
objects=[{"sourceId":16,"globalIds":["{D103F8F1-B186-4442-82F7-29C58C281DA9}","{04D36A29-5B27-4357-A40F-176938EA7596}"]}]
attachmentAssociations=true
connectivityAssociations=true
containmentAssociations=true
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
{
	"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
}

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