cartagen.network_faces#
- network_faces(*networks, convex_hull=True)#
Calculates the faces of one or multiple networks.
This function is often called polygonize. It creates polygons in place of a network of lines.
- Parameters:
*networks (
listofLineString) – The networks to generate the faces from. All the provided lists are merged into one list of geometries.convex_hull (
bool, optional) – If True, add the convex hull of the provided list of lines to the network, thus including the borders.
- Returns:
See also
partition_networksPartition objects using one or multiple networks.
partition_quadtreePartition objects using a quadtree.
Notes
When the network is not completely planar (e.g. tunnels and bridges inside a road network with crossing sections not intersecting), the network is fully unioned and merged.
Examples
>>> lines = [LineString([(0, 0), (1, 1), (2, 0), (3, 1)])] >>> list(network_faces(lines)) [<POLYGON ((1 1, 3 1, 2 0, 1 1))>, <POLYGON ((2 0, 0 0, 1 1, 2 0))>]