mappymatch.maps.nx.readers.osm_readers#
Functions
|
a hacky way to delete unnecessary data on the networkx graph |
|
Build a networkx graph from OSM data |
|
Parse the raw osmnx graph into a graph that we can use with our NxMap |
Classes
|
Enumerator for Network Types supported by osmnx. |
- class mappymatch.maps.nx.readers.osm_readers.NetworkType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Enumerator for Network Types supported by osmnx.
- ALL_PRIVATE = 'all_private'#
- ALL = 'all'#
- BIKE = 'bike'#
- DRIVE = 'drive'#
- DRIVE_SERVICE = 'drive_service'#
- WALK = 'walk'#
- mappymatch.maps.nx.readers.osm_readers.nx_graph_from_osmnx(geofence, network_type, xy=True, custom_filter=None)[source]#
Build a networkx graph from OSM data
- Return type:
MultiDiGraph
- Parameters:
geofence (Geofence)
network_type (NetworkType)
xy (bool)
custom_filter (str | None)
- Args:
geofence: the geofence to clip the graph to network_type: the network type to use for the graph xy: whether to use xy coordinates or lat/lon custom_filter: a custom filter to pass to osmnx
- Returns:
a networkx graph of the OSM network
- mappymatch.maps.nx.readers.osm_readers.parse_osmnx_graph(graph, network_type, xy=True)[source]#
Parse the raw osmnx graph into a graph that we can use with our NxMap
- Return type:
MultiDiGraph
- Parameters:
graph (MultiDiGraph)
network_type (NetworkType)
xy (bool)
- Args:
geofence: the geofence to clip the graph to xy: whether to use xy coordinates or lat/lon network_type: the network type to use for the graph
- Returns:
a cleaned networkx graph of the OSM network