- momepy.enclosures(primary_barriers, limit=None, additional_barriers=None, enclosure_id='eID', clip=False)[source]#
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
limitand its subdivision based on additional_barriers.
- primary_barriersGeoDataFrame, GeoSeries
A GeoDataFrame or GeoSeries containing primary barriers. (Multi)LineString geometry is expected.
- limitGeoDataFrame, GeoSeries, shapely geometry (default None)
A GeoDataFrame, GeoSeries or shapely geometry containing external limit of enclosures, i.e. the area which gets partitioned. If
Noneis passed, the internal area of
primary_barrierswill be used.
A GeoDataFrame or GeoSeries containing additional barriers. (Multi)LineString geometry is expected.
- enclosure_idstr (default ‘eID’)
The name of the
enclosure_id(to be created).
- clipbool (default False)
True, returns enclosures with representative point within the limit (if given). Requires
limitcomposed of Polygon or MultiPolygon geometries.
A GeoDataFrame containing enclosure geometries and
>>> enclosures = mm.enclosures(streets, admin_boundary, [railway, rivers])