Readers

(Reserved for future use)

You can use these to generate a map for various sources.

Readers Module

class NetworkType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Enumerator for Network Types supported by osmnx.

compress(g) 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: Geofence, network_type: NetworkType, xy: bool = True, custom_filter: str | None = None) 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

  • custom_filter – a custom filter to pass to osmnx

Returns:

a networkx graph of the OSM network

parse_osmnx_graph(graph: MultiDiGraph, network_type: NetworkType, xy: bool = True) 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