Openstreet Roads#
- shift.get_road_network(location: str | ~shift.data_model.GeoLocation | list[~shift.data_model.GeoLocation] | ~shapely.geometry.polygon.Polygon, max_distance: ~infrasys.quantities.Distance = <Quantity(500, 'meter')>) Graph #
Function to return networkx graph representation for a road network.
Note max_distance is not used if location type is Polygon. For a location of type str and GeoLocation, a polygon is created by forming a sqaure bounding box using max distance. We use osmnx package to fetch road network
- Parameters:
location (str | GeoLocation | Polygon) – Location for which openstreet parcels are to be fetched.
max_distance (Distance) – Maximum distance to form a bounding box within which buildings are fetched.
- Returns:
Instance of nx.Graph.
- Return type:
nx.Graph
Examples
>>> get_road_network("Fort Worth, Texas", Distance(100, "m"))