WaterNetworkGIS#
module wntr.gis.network
- class WaterNetworkGIS[source]#
Bases:
object
Water network GIS class
Contains methods to create GeoDataFrames from WaterNetworkModel and create WaterNetworkModel from GeoDataFrames.
- Parameters:
gis_data (dict, optional) – Dictionary of GeoDataFrames containing data to populate an instance of WaterNetworkGIS. Valid dictionary keys are ‘junction’, ‘tanks’, ‘reservoirs’, ‘pipes’, ‘pumps’, and ‘valves’
- Raises:
ModuleNotFoundError – if missing either shapely or geopandas
- add_node_attributes(values, name)[source]#
Add attribute to junctions, tanks, or reservoirs GeoDataFrames
- read_geojson(files, index_col='name')[source]#
Append information from GeoJSON files to a WaterNetworkGIS object
- Parameters:
files (dictionary) – Dictionary of GeoJSON filenames, where the keys are in the set (‘junction’, ‘tanks’, ‘reservoirs’, ‘pipes’, ‘pumps’, ‘valves’) and values are the corresponding GeoJSON filename
index_col (str, optional) – Column that contains the element name
- read_shapefile(files, index_col='name')[source]#
Append information from Esri Shapefiles to a WaterNetworkGIS object
- Parameters:
files (dictionary) – Dictionary of Shapefile directory or filenames, where the keys are in the set (‘junction’, ‘tanks’, ‘reservoirs’, ‘pipes’, ‘pumps’, ‘valves’) and values are the corresponding GeoJSON filename
index_col (str, optional) – Column that contains the element name
- set_crs(crs, allow_override=False)[source]#
Set CRS of the junctions, tanks, reservoirs, pipes, pumps, and valves GeoDataFrames.
Calls geopandas.GeoDataFrame.set_crs on each GeoDataFrame.
- to_crs(crs)[source]#
Transform CRS of the junctions, tanks, reservoirs, pipes, pumps, and valves GeoDataFrames.
Calls geopandas.GeoDataFrame.to_crs on each GeoDataFrame.
- Parameters:
crs (str) – Coordinate reference system