Geometric Network Utility SOE Rest
Author: Domenico Ciavarella
www.studioat.it
This solution (developed in c#) creates a SOE Rest in arcgis server 10.0 with msd for these operations:
-Trace trace
-Valve isolation
Installation:
a) upload file Studioat.ArcGis.Soe.Rest.GeometricNetworkUtility.soe (see http://resources.arcgis.com/en/help/main/10.1/0154/0154000004sm000000.htm)
b) create a service map and enable in capabilities the extension. In this msd you must have at least a geometric Network
c) from service directory you can see all your Geometric Network
http://hostname/instanceags/rest/services/yourservice/MapServer/exts/GeometricNetworkUtility
d) TraceNetwork and IsolateValve operation for Geometry Network (example with id=1. To know id use request c)
http://hostname/instanceags/rest/services/yourservice/MapServer/exts/GeometricNetworkUtility/GeometricNetworks/1/TraceNetwork
http://hostname/instanceags/rest/services/yourservice/MapServer/exts/GeometricNetworkUtility/GeometricNetworks/1/IsolateValve
To see weights:
http://hostname/instanceags/rest/services/yourservice/MapServer/exts/GeometricNetworkUtility/GeometricNetworks/1
TraceNetwork:
traceSolverType: FindAccumulation or FindCircuits or FindCommonAncestors or FindFlowElements or FindFlowEndElements or FindFlowUnreachedElements or FindPath or FindSource or IsolateValve
flowMethod: enum arcobjects esriFlowMethod
flowElements: enum arcobjects esriFlowElements
edgeFlags: array of geometries(point) (see rest esri point)
junctionFlags: array of geometries(point) (see rest esri point)
edgeBarriers: array of geometries(point) (see rest esri point)
junctionBarriers: array of geometries(point) (see rest esri point)
maxTracedFeatures: max number of edge or junction that can be returned
tolerance: in map units to search for flag or barrier
traceIndeterminateFlow: booleran (optional)
shortestPathObjFn: required only for FindPath or FindSource (optional)
disableLayers: array of int. Id of layers (optional)
outFields: list of fields in result ('*' for all fields). This list is common for all feature class in geometric network.
junctionWeight:(optional)
fromToEdgeWeight:(optional)
toFromEdgeWeight:(optional)
junctionFilterWeight:(optional)
junctionFilterRanges:(optional)
junctionFilterNotOperator: boolean (optional)
fromToEdgeFilterWeight:(optional)
toFromEdgeFilterWeight:(optional)
edgeFilterRanges:(optional)
edgeFilterNotOperator: boolean(optional)
IsolateValve:
stationLayerId: int. Id of station layer
valveLayerId: int. Id of valve layer
flowElements: enum arcobjects esriFlowElements
edgeFlags: array of geometries(point) (see rest esri point)
junctionFlags: array of geometries(point) (see rest esri point)
edgeBarriers: for now not used
junctionBarriers: for now not used
maxTracedFeatures: max number of edge or junction that can be returned
tolerance: in map units to search for flag or barrier
outFields: list of fields in result ('*' for all fields). This list is common for all feature class in geometric network.
I have added in file zip an example in api esri javascript to see how to use it.
To use this sample download InfrastructureEditingTemplate.zip from esri site
1) create a msd from InfrastructureEditing.mxd (http://www.arcgis.com/home/item.html?id=14bdfb26bc2f4e0388a633fbd0ccca02).
You need only the first three group layers (Water Distribution System, Sewer Collection System, Stormwater Network)
with only the first visible (Water Distribution System).
2) you create a service with enabled capabilites Geometric Network.
3) open config.js and set config.host, config.instance and config.operationalLayers = {GNLayer:'yourService'};
In ArcCatalog in capabilities (operations allowed) you can allow these operations (TraceNetwork, IsolateValve).
The solutions are checked 100% with stylecop and fxcop.