ArcGIS REST API

Query Diagram Elements By Extent (Network Diagrams)

  • URL:http://<diagram-url>/queryDiagramElementsByExtent
  • Version Introduced:pro1.4

Description

The queryDiagramElementsByExtent operation is performed on a Diagram resource. The result of this operation is a JSON object composed of three arrays—one for the resulting diagram junctions, one other for the resulting diagram edges and the third one for the diagram containers.

It returns the set of diagram features—that is, diagram junctions, diagram edges and/or diagram containers—represented in the diagram resource that intersect a specified envelope—this one being optionally enlarged to include any containers that may be partially within it.

License:
The ArcGIS Utility Network Management extension is required to use this operation.

Request Parameters

ParameterDetails
gdbVersion

Description: The name of the geodatabase version.

Syntax: gdbVersion=<version>

Example: gdbVersion=ABV1

sessionId

Description: The token (guid) used to lock the version.

Syntax: sessionId=<guid>

Example: sessionId=44G259DE-87B0-407D-8F2E-DCB7665DD0F0

moment

Description: The session moment.

Syntax: moment=<moment>

Example: moment=1490867969324

extent

Description: A JSON envelope object representing the extent you want the resulting diagram features to intersect.

Without specifying this parameter, the operation returns all the diagram features in the resource diagram.

Syntax:

extent=
{
 "xmin": <xmin>, "ymin": <ymin>, 
 "xmax": <xmax>, "ymax": <ymax>,
 "zmin": <zmin>, "zmax": <zmax>,
 "mmin": <mmin>, "mmax": <mmax>,
 "spatialReference": <spatialReference>}
}

Example:

Retrieving diagram features intersecting a given envelope:

extent=
{
"xmin": 1030002.4739352614, "ymin": 1862854.181471862, "xmax": 1030398.5958464295, "ymax": 1863341.463633, "spatialReference": {"wkid": 102671}
}

addContents

Description: Boolean.

  • False—to return the diagram features which strictly intersect the specified envelope (default),
  • True—to enlarge the "searching" envelope so it includes the extent of any containers that are partially within the specified envelope.

Syntax: addContents=<true | false>

Example: addContents=true

returnJunctions

Description: Boolean.

  • True—to return the diagram junctions (default),
  • False—to not return the diagram junctions.

Syntax: returnJunctions=<true | false>

Example: returnJunctions=true

returnEdges

Description: Boolean.

  • True—to return the diagram edges (default),
  • False—to not return the edges junctions.

Syntax: returnEdges=<true | false>

Example: returnEdges=true

returnContainers

Description: Boolean.

  • True—to return the diagram containers (default),
  • False—to not return the diagram containers.

Syntax: returnContainers=<true | false>

Example: returnContainers=true

returnGeometry

Description: Boolean.

  • True—to return each queried diagram feature with its geometry (default),
  • False—to return each queried diagram feature without its geometry.

Syntax: returnGeometry=<true | false>

Example: returnGeometry=true

f

Description: The response format. The default response format is html.

Values: <html | json>

Example Usage

Querying all the junctions of the Basic_RMT001 diagram: http://batz.esri.com/server/rest/services/Naperville/NetworkDiagramServer/diagrams/Basic_RMT001/queryDiagramElementsByExtent?gdbVersion=&sessionId=&moment=&extent=&addContents=&returnJunctions=true&returnEdges=false&returnContainers=false&returnGeometry=&f=pjson

Querying all the diagram features that intersect a given extent{"xmin": 1034510.4869008437,"ymin": 1871859.3734351993,"xmax": 1034521.7178495117,"ymax": 1871863.1050550342,"spatialReference": {"wkid": 102671,"latestWkid": 3435}}: http://batz.esri.com/server/rest/services/Naperville/NetworkDiagramServer/diagrams/Basic_RMT003/queryDiagramElementsByExtent?gdbVersion=&sessionId=&moment=&extent=%7B%22xmin%22%3A+1034510.4869008437%2C%22ymin%22%3A+1871859.3734351993%2C%22xmax%22%3A+1034521.7178495117%2C%22ymax%22%3A+1871863.1050550342%2C%22spatialReference%22%3A+%7B%22wkid%22%3A+102671%2C%22latestWkid%22%3A+3435%7D%7D&addContents=&returnJunctions=&returnEdges=&returnContainers=&returnGeometry=&f=pjson

JSON Response Syntax

A JSON object composed of maximum three arrays depending on the value specified for the returnJunctions, returnEdges and returnContainers parameters; that is:

  • An array of <diagramJunction> JSON objects, when returnJunctions = true
  • An array of <diagramEdge> JSON objects, when returnEdges = true
  • An array of <diagramContainer> JSON objects, when returnContainers = true

{
 "diagramJunctions": [<diagramJunction1>, ..., < diagramJunctionK>],
 "diagramEdges": [<diagramEdge1>, ..., < diagramEdgeM>],
 "diagramContainers": [<diagramContainer1>, ..., <diagramContainerN>]
}

Wth the following JSON object syntaxes:

  • <diagramJunction> JSON object syntax:
    {
     "id": <ID>, //int
     "containerID": <containerID>, //int
     "featureOID": <jctOID>, //int
     "globalID": <diagFeatureGUID>, // string
     "assocSourceID": <assUNSourceID>, //int
     "assocGlobalID": "<assUNfeatureGUID>", // string
     "geometry": {
       "x": <x>, //double
       "y": <y>, //double
       "z": <z>, //double
       "m": <m> //double
     },
     "rotation": <rotation> //int
    }
  • <diagramEdge> JSON object syntax:
    {
     "id": <ID>, // long
     "containerID": <containerID>, // long
     "featureOID": <edgeOID>, // long
     "globalID": <diagFeatureGUID>, // string
     "assocSourceID": <assUNSourceID>, // long
     "assocGlobalID": "<assUNfeatureGUID>", // string
     "geometry": {
      "hasM" : < true | false >,
      "paths" : [[[<x11>, <y11>, <z11>, <m11>],…,[<x1N>, <y1N>, <z1N>, <m1N>]],
                 ,…,[[<xk1>, <yk1>, <zk1>, <mk1>],…,[<xkM>, <ykM>, <zkM>, <mkM>]]]},
     "fromID": <FromID>, // long
     "toID": <ToID>, // long
    }
  • <diagramContainer> JSON object syntax:
    {
     "id": <ID>, //int
     "containerID": <containerID>, // long
     "featureOID": <containerOID>, // long
     "globalID": <diagFeatureGUID>, // string
     "assocSourceID": <assUNSourceID>, // long
     "assocGlobalID": "<assUNfeatureGUID>", // string
     "geometry": {
       "hasZ" : true | false,
       "hasM" : true | false,
       "rings" : [[[<x11>, <y11>, <z11>, <m11>],...,[<x1N>, <y1N>, <z1N>, <m1N>]],
                 ,...,[[<xk1>, <yk1>, <zk1>, <mk1>],...,[<xkM>, <ykM>, <zkM>, <mkM>]]],
      }
    }

JSON Response Example

Sample response when returnGeometry is True (default)

{
 "diagramJunctions": [
  {
   "id": 7,
   "containerID": 6,
   "featureOID": 18806,
   "globalID": "{D337C4F7-2B24-4072-988B-D45F7D10D376}",
   "assocSourceID": 6,
   "assocGlobalID": "{2403ED10-BBBE-4DF6-AF29-65998FADB99F}",
   "rotation": 0,
   "geometry": {
    "x": 1034253.57566926256,
    "y": 1869160.674764365,
    "m": null
   }
  },
  {
   "id": 9,
   "containerID": 6,
   "featureOID": 18808,
   "globalID": "{6DD5ADB0-DF35-4F0D-8C21-186AAC5E1C4A}",
   "assocSourceID": 9,
   "assocGlobalID": "{C366397B-3088-46A1-80E7-ACFDA4BB812F}",
   "rotation": 0,
   "geometry": {
    "x": 1034253.57501309365,
    "y": 1869160.42476486415,
    "m": null
   }
  }
 ],
 "diagramEdges": [
  {
   "id": 1199,
   "containerID": 6,
   "featureOID": 19820,
   "globalID": "{AB16E11A-D3B0-404D-A8F1-6283DA20B66F}",
   "assocSourceID": 1,
   "assocGlobalID": "{D1E28A6B-B6A2-4C6B-8604-E4B79D719B06}",
   "fromID": 7,
   "toID": 9,
   "geometry": {
    "hasM": true,
    "paths": [
     [
      [
       1034253.57566926256,
       1869160.674764365,
       null
      ],
      [
       1034253.57501309365,
       1869160.42476486415,
       null
      ]
     ]
    ]
   }
  }
 ],
 "diagramContainers": [
  
 ]
}

Sample response when returnGeometry is False

{
 "diagramJunctions": [
  {
   "id": 7,
   "containerID": 6,
   "featureOID": 18806,
   "globalID": "{D337C4F7-2B24-4072-988B-D45F7D10D376}",
   "assocSourceID": 6,
   "assocGlobalID": "{2403ED10-BBBE-4DF6-AF29-65998FADB99F}",
   "rotation": 0
  },
  {
   "id": 9,
   "containerID": 6,
   "featureOID": 18808,
   "globalID": "{6DD5ADB0-DF35-4F0D-8C21-186AAC5E1C4A}",
   "assocSourceID": 9,
   "assocGlobalID": "{C366397B-3088-46A1-80E7-ACFDA4BB812F}",
   "rotation": 0
  }
 ],
 "diagramEdges": [
  {
   "id": 1199,
   "containerID": 6,
   "featureOID": 19820,
   "globalID": "{AB16E11A-D3B0-404D-A8F1-6283DA20B66F}",
   "assocSourceID": 1,
   "assocGlobalID": "{D1E28A6B-B6A2-4C6B-8604-E4B79D719B06}",
   "fromID": 7,
   "toID": 9
  }
 ],
 "diagramContainers": [
  
 ]
}