swn.SurfaceWaterNetwork.catchments#

property SurfaceWaterNetwork.catchments#

Polygon GeoSeries of surface water catchments.

Catchment polygons are optional, and are set with a GeoSeries with a matching index to segments.index.

To unset this property, use n.catchments = None.

Examples

>>> import geopandas
>>> import swn
>>> lines = geopandas.GeoSeries.from_wkt([
...    "LINESTRING (60 100, 60  80)",
...    "LINESTRING (40 130, 60 100)",
...    "LINESTRING (70 130, 60 100)"])
>>> lines.index += 100
>>> polygons = geopandas.GeoSeries.from_wkt([
...    "POLYGON ((35 100, 75 100, 75  80, 35  80, 35 100))",
...    "POLYGON ((35 135, 60 135, 60 100, 35 100, 35 135))",
...    "POLYGON ((60 135, 75 135, 75 100, 60 100, 60 135))"])
>>> polygons.index += 100
>>> n = swn.SurfaceWaterNetwork.from_lines(lines, polygons)
>>> n
<SurfaceWaterNetwork: with catchment polygons
  3 segments: [100, 101, 102]
  2 headwater: [101, 102]
  1 outlets: [100]
  no diversions />
>>> n.segments[["to_segnum", "from_segnums", "upstream_area", "width"]]
     to_segnum from_segnums  upstream_area     width
100          0   {101, 102}         2200.0  1.461501
101        100           {}          875.0  1.445695
102        100           {}          525.0  1.439701