Readers
(Reserved for future use)
You can use these to generate a map for various sources.
Readers Module
- compress(g) networkx.classes.multidigraph.MultiDiGraph [source]
a hacky way to delete unnecessary data on the networkx graph
- Parameters
g – the networkx graph to compress
- Returns
the compressed networkx graph
- nx_graph_from_osmnx(geofence: mappymatch.constructs.geofence.Geofence, network_type: mappymatch.maps.nx.readers.osm_readers.NetworkType, xy: bool = True) networkx.classes.multidigraph.MultiDiGraph [source]
Build a networkx graph from OSM data
- Parameters
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
- Returns
a networkx graph of the OSM network
- parse_osmnx_graph(graph: networkx.classes.multidigraph.MultiDiGraph, network_type: mappymatch.maps.nx.readers.osm_readers.NetworkType, xy: bool = True) networkx.classes.multidigraph.MultiDiGraph [source]
Parse the raw osmnx graph into a graph that we can use with our NxMap
- Parameters
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