momepy.
enclosures
Generate enclosures based on passed barriers.
Enclosures are areas enclosed from all sides by at least one type of a barrier. Barriers are typically roads, railways, natural features like rivers and other water bodies or coastline. Enclosures are a result of polygonization of the primary_barrier and limit and its subdivision based on additional_barriers.
primary_barrier
limit
GeoDataFrame or GeoSeries containing primary barriers. (Multi)LineString geometry is expected.
GeoDataFrame or GeoSeries containing external limit of enclosures, i.e. the area which gets partitioned. If None is passed, the internal area of primary_barriers will be used.
primary_barriers
GeoDataFrame or GeoSeries containing additional barriers. (Multi)LineString geometry is expected.
name of the enclosure_id (to be created).
GeoDataFrame containing enclosure geometries and enclosure_id
Examples
>>> enclosures = mm.enclosures(streets, admin_boundary, [railway, rivers])