Geometric Network Utility SOE Rest
http://nicogis.blogspot.it

for info Geometric Network
http://nicogis.blogspot.it/2012/05/geometric-network.html

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) register unregister dll and soe

- register dll in SOC machine
1) %WINDIR%\Microsoft.NET\Framework\v2.0.50727\regasm Studioat.ArcGis.Soe.Rest.GeometricNetworkUtility.dll /codebase

- register soe in ArcGIS server (SOM)
1) Studioat.ARCGIS.SOE.Registra -c Studioat.ArcGis.Soe.Rest.GeometricNetworkUtility -n GeometricNetworkUtility -l "Your title"

for unregister
1) Studioat.ARCGIS.SOE.Registra -n GeometricNetworkUtility -u
2) %WINDIR%\Microsoft.NET\Framework\v2.0.50727\regasm Studioat.ArcGis.Soe.Rest.GeometricNetworkUtility.dll /codebase /u

Note: when you register with option codebase, you have a warning because I haven't signed the dll. So, if the component is not to be
deployed to the global assembly cache (GAC), then this option will be required for ArcGIS to find your component successfully;
if the component is installed to the GAC (you sign the dll), the option is not required.

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

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.

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

Video: http://www.youtube.com/watch?v=b3D0G68waL8

Last edited Jun 7, 2012 at 12:10 PM by nicogis, version 2

Comments

No comments yet.