Skip To Content

Query Diagram Elements By Extent (Network Diagrams)

  • URL:https://<diagram-url>/queryDiagramElementsByExtent
  • Version Introduced:10.7

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, another for the resulting diagram edges, and the third one for the diagram containers.

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

License:
The active portal account must be licensed with the ArcGIS Advanced Editing user type extension 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

outSR

Description: The spatial reference of the returned geometry.

The spatial reference can be specified as either a well-known ID or as a spatial reference JSON object.

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

f

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

Values: <html | json>

Example usage

Query all the junctions of the Basic_RMT001 diagram:

  • URL: https://myserver.esri.com/server/rest/services/Naperville/NetworkDiagramServer/diagrams/Basic_RMT001/queryDiagramElementsByExtent
  • Parameters
    gdbVersion=
    sessionId=
    moment=
    extent=
    addContents=
    returnJunctions=true
    returnEdges=false
    returnContainers=false
    returnGeometry=
    outSR=
    f=pjson
  • Sent URL (GET): https://myserver.esri.com/server/rest/services/Naperville/NetworkDiagramServer/diagrams/Basic_RMT001/queryDiagramElementsByExtent?gdbVersion=&sessionId=&moment=&extent=&addContents=&returnJunctions=true&returnEdges=false&returnContainers=false&returnGeometry=&outSR=&f=pjson

Query 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}}:

  • URL: https://myserver.esri.com/server/rest/services/Naperville/NetworkDiagramServer/diagrams/Basic_RMT003/queryDiagramElementsByExtent
  • Parameters
    gdbVersion=
    sessionId=
    moment=
    extent={"xmin": 1034510.4869008437,
     "ymin": 1871859.3734351993,
     "xmax": 1034521.7178495117,
     "ymax": 1871863.1050550342,
     "spatialReference": {
      "wkid": 102671,
      "latestWkid": 3435
     }
    }
    addContents=
    returnJunctions=
    returnEdges=
    returnContainers=
    returnGeometry=
    outSR=
    f=pjson
  • Sent URL (GET): https://myserver.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=&outSR=&f=pjson

JSON Response syntax

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

  • 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 >]
}

With 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
       "spatialReference": < spatialReference >
     },
     "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 >]]],
      "spatialReference": < spatialReference >
     },
     "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 >]]],
      "spatialReference": < spatialReference >}
    }

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,
    "spatialReference": {
     "wkid": 102671,
     "latestWkid": 3435,
     "vcsWkid": 105703,
     "latestVcsWkid": 6360
    }
   }
  },
  {
   "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,
    "spatialReference": {
     "wkid": 102671,
     "latestWkid": 3435,
     "vcsWkid": 105703,
     "latestVcsWkid": 6360
    }
   }
  }
 ],
 "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
      ]
     ]
    ],
    "spatialReference": {
     "wkid": 102671,
     "latestWkid": 3435,
     "vcsWkid": 105703,
     "latestVcsWkid": 6360
    }
   }
  }
 ],
 "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": [
  
 ]
}