Zone
The Zone API lets you get information about the zones in the network. You can get a list of all the zones in the network using the getZones
method of the Network object.
Properties
id
A string representing the zone’s unique identifier.
geometry
The geometry of the zone, as a GeoJSON MultiPolygon object.
inlets
An array representing the inlets of the zone. Objects in the array are of type Pipe.
outlets
An array representing the outlets of the zone. Objects in the array are of type Pipe.
Asset Queries
getAsset()
Returns the zone asset with the specified id, as an Asset object.
Method signature
getAssets()
Returns an array with all the assets in the zone that match the filter function, as Asset objects. If no filter is provided, all the assets in the zone are returned.
Method signature
Example
Get all the pipes in the “Nelly Bay DMA” zone:
For your convenience, the following methods return an array of specific types of assets:
getBoundaryValves()
Returns an array with all the boundary valves in the zone, as Valve objects.
Method signature
getJunctions()
Returns an array with all the junctions in the zone that match the filter function, as Junction objects. If no filter is provided, all the junctions in the zone are returned.
Method signature
Example
Get all the junctions in the “Nelly Bay DMA” zone, with an elevation that’s lower than 1:
getPipes()
Returns an array with all the pipes in the zone that match the filter function, as Pipe objects. If no filter is provided, all the pipes in the zone are returned.
Method signature
Example
Get all the pipes in the “Nelly Bay DMA” zone, with a diameter that’s greater than 20:
getPumps()
Returns an array with all the pumps in the zone that match the filter function, as Pump objects. If no filter is provided, all the pumps in the zone are returned.
Method signature
Example
Get all the pumps in the “Nelly Bay DMA” zone, with a relative speed setting equal to 1:
getSupplySources()
Returns an array with all the supply sources in the zone that match the filter function, as SupplySource objects. If no filter is provided, all the supply sources in the zone are returned.
Method signature
Example
Get all the supply sources in the “Nelly Bay DMA” zone, with a head greater than zero:
getTanks()
Returns an array with all the tanks in the zone that match the filter function, as Tank objects. If no filter is provided, all the tanks in the zone are returned.
Method signature
Example
Get all the tanks in the “Nelly Bay DMA” zone, with a level that’s greater than 1:
getValves()
Returns an array with all the valves in the zone that match the filter function, as Valve objects. If no filter is provided, all the valves in the zone are returned.
Method signature
Example
Get all the closed valves in the “Nelly Bay DMA” zone: