spaghetti.element_as_gdf(net, vertices=False, arcs=False, pp_name=None, snapped=False, id_col='id', geom_col='geometry')[source]¶Return a geopandas.GeoDataFrame of network elements. This can be (a) the vertices of a network; (b) the arcs of a network; (c) both the vertices and arcs of the network; (d) raw point pattern associated with the network; or (e) snapped point pattern of (d).
network object
Extract the network vertices. Default is False.
Extract the network arcs. Default is False.
Name of the network PointPattern to extract.
Default is None.
If extracting a network PointPattern, set to True for
snapped point locations along the network. Default is False.
GeoDataFrame column name for IDs. Default is 'id'.
GeoDataFrame column name for geometry. Default is
'geometry'.
Network point elements (either vertices or PointPattern
points) as a geopandas.GeoDataFrame of shapely.Point
objects with an id column and geometry column.
Network arc elements as a geopandas.GeoDataFrame of
shapely.LineString objects with an id column and
geometry column.
In order to extract a PointPattern it must already be a part
of the spaghetti.Network object. This exception is raised
when a PointPattern is being extracted that does not exist
within the spaghetti.Network object.
Notes
This function requires geopandas.