Skip To Content

Query Diagram Elements By ObjectIDs (Network Diagrams)

  • URL:https://<diagram-url>/queryDiagramElementsByObjectIDs
  • Version Introduced: 10.6

Description

The queryDiagramElementsByObjectIDs 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—that is, diagram junctions, diagram edges, or diagram containers—represented in the diagram resource with the specified ObjectIDs. Then when specifying diagram edge ObjectIDs, optionally, extend the resulting set of diagram elements to the junctions they are connected to or when specifying diagram container ObjectIDs, optionally, extend the resulting set of diagram elements to the edge, junction, or container diagram elements they contain.

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

addConnected

Description: Boolean

  • False—Doesn't enlarge the returned diagram junctions to those that are from or to junctions of the specified edgeObjectIDs (default)
  • True—Enlarges the returned diagram junctions to those that are from or to junctions of the specified edgeObjectIDs

Syntax: addConnected=<true | false>

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

junctionObjectIDs

Description: List of junction ObjectIDs (long) that must be queried

Syntax: junctionObjectIDs=[<DiagJctOid1>, …, <DiagJctOidN]

Example: junctionObjectIDs=[1,2,3,4,5]

containerObjectIDs

Description: List of container ObjectIDs (long) that must be queried

Syntax: containerObjectIDs=[<DiagConOid1>, …, <DiagConOidN]

Example: containerObjectIDs=[1]

edgeObjectIDs

Description: List of edge ObjectIDs (long) that must be queried

Syntax: edgeObjectIDs=[<DiagEdgOid1>, …, <DiagEdgOidN]

Example: edgeObjectIDs=[1,2,3]

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 the container in which the diagram ObjectID is 917 in the Basic_RMT003 diagram and all its contents:

  • URL: https://myserver.esri.com/server/rest/services/Naperville/NetworkDiagramServer/diagrams/Basic_RMT003/queryDiagramElementsByObjectIDs
  • Parameters
    gdbVersion=
    sessionId=
    moment=
    addContents=true
    addConnected=
    returnGeometry=
    junctionObjectIDs=
    containerObjectIDs=[917]
    edgeObjectIDs=
    outSR=
    f=pjson
  • Sent URL (GET): https://myserver.esri.com/server/rest/services/Naperville/NetworkDiagramServer/diagrams/Basic_RMT003/queryDiagramElementsByObjectIDs?gdbVersion=&sessionId=&moment=&addContents=true&addConnected=&returnGeometry=&junctionObjectIDs=&containerObjectIDs=%5B917%5D&edgeObjectIDs=&outSR=&f=pjson

Query the edge on which the diagram ObjectID is 6563 in the Basic_RMT003 diagram and the junctions it is connected to:

  • URL: https://myserver.esri.com/server/rest/services/Naperville/NetworkDiagramServer/diagrams/Basic_RMT003/queryDiagramElementsByObjectIDs
  • Parameters
    gdbVersion=
    sessionId=
    moment=
    addContents=
    addConnected=true
    returnGeometry=
    junctionObjectIDs=
    containerObjectIDs=
    edgeObjectIDs=[6563]
    outSR=
    f=pjson
  • Sent URL (GET): https://myserver.esri.com/server/rest/services/Naperville/NetworkDiagramServer/diagrams/Basic_RMT003/queryDiagramElementsByObjectIDs?gdbVersion=&sessionId=&moment=&addContents=&addConnected=true&returnGeometry=&junctionObjectIDs=&containerObjectIDs=&edgeObjectIDs=%5B6563%5D&outSR=&f=pjson

JSON Response syntax

A JSON object composed of three arrays:

  • An array of <diagramJunction> JSON objects
  • An array of <diagramEdge> JSON objects
  • An array of <diagramContainer> JSON objects

{
 "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": 34,
   "containerID": 33,
   "featureOID": 5730,
   "globalID": "{1D295458-E0C9-4DA9-BC48-C816D1919FCC}",
   "assocSourceID": 6,
   "assocGlobalID": "{16F7006D-A5C2-4224-BD48-82729CB9D2A4}",
   "rotation": 0,
   "geometry": {
    "x": 1027036.95854084566,
    "y": 1864282.70584578067,
    "m": null,
    "spatialReference": {
     "wkid": 102671,
     "latestWkid": 3435,
     "vcsWkid": 105703,
     "latestVcsWkid": 6360
    }
   }
  },
  {
   "id": 35,
   "containerID": 33,
   "featureOID": 5731,
   "globalID": "{32830EEF-492E-4E21-9493-B619E234841C}",
   "assocSourceID": 6,
   "assocGlobalID": "{2C80026C-3D06-478C-91C5-B7966EAE23C3}",
   "rotation": 0,
   "geometry": {
    "x": 1027036.81319992989,
    "y": 1864282.90827319771,
    "m": null,
    "spatialReference": {
     "wkid": 102671,
     "latestWkid": 3435,
     "vcsWkid": 105703,
     "latestVcsWkid": 6360
    }
   }
  }
 ],
 "diagramEdges": [
  {
   "id": 4568,
   "containerID": 0,
   "featureOID": 6563,
   "globalID": "{5C98D3A4-0E43-4324-8B87-A17DB78290FC}",
   "assocSourceID": 1,
   "assocGlobalID": "{FCC2BE31-C3DE-4C5D-9E48-1CA36EBA3961}",
   "fromID": 35,
   "toID": 34,
   "geometry": {
    "hasM": true,
    "paths": [
     [
      [
       1027036.81319992989,
       1864282.90827319771,
       null
      ],
      [
       1027036.95854084566,
       1864282.70584578067,
       null
      ]
     ]
    ],
    "spatialReference": {
     "wkid": 102671,
     "latestWkid": 3435,
     "vcsWkid": 105703,
     "latestVcsWkid": 6360
    }
   }
  }
 ],
 "diagramContainers": [
  
 ]
}

Sample response when returnGeometry is False

{
 "diagramJunctions": [
  {
   "id": 34,
   "containerID": 33,
   "featureOID": 5730,
   "globalID": "{1D295458-E0C9-4DA9-BC48-C816D1919FCC}",
   "assocSourceID": 6,
   "assocGlobalID": "{16F7006D-A5C2-4224-BD48-82729CB9D2A4}",
   "rotation": 0
  },
  {
   "id": 35,
   "containerID": 33,
   "featureOID": 5731,
   "globalID": "{32830EEF-492E-4E21-9493-B619E234841C}",
   "assocSourceID": 6,
   "assocGlobalID": "{2C80026C-3D06-478C-91C5-B7966EAE23C3}",
   "rotation": 0
  }
 ],
 "diagramEdges": [
  {
   "id": 4568,
   "containerID": 0,
   "featureOID": 6563,
   "globalID": "{5C98D3A4-0E43-4324-8B87-A17DB78290FC}",
   "assocSourceID": 1,
   "assocGlobalID": "{FCC2BE31-C3DE-4C5D-9E48-1CA36EBA3961}",
   "fromID": 35,
   "toID": 34
  }
 ],
 "diagramContainers": [
  
 ]
}