cityImage.get_network_fromOSM#
- cityImage.get_network_fromOSM(place, download_method, network_type='all', epsg=None, distance=500.0)[source]#
The function downloads and creates a simplified OSMNx graph for a selected area’s street network. Afterwards, GeoDataFrames for nodes and edges are created, assigning new nodeID and edgeID identifiers.
- Parameters:
place (str, tuple) – Name of cities or areas in OSM: - when using “distance_from_point” please provide a (lat, lon) tuple to create the bounding box around it; - when using “distance_from_address” provide an existing OSM address; - when using “OSMplace” provide an OSM place name. - when using “OSMpolygon” please provide the name of a relation in OSM as an argument of place;
download_method (str, {"distance_from_address", "distance_from_point", "OSMpolygon", "OSMplace", "polygon"}) – It indicates the method that should be used for downloading the data. When ‘polygon’ the shape to get network data within coordinates should be in unprojected latitude-longitude degrees (EPSG:4326).
network_type (str {"walk", "bike", "drive", "drive_service", "all", "all_private", "none"}) – It indicates type of street or other network to extract - from OSMNx paramaters.
epsg (int) – Epsg of the area considered; if None OSMNx is used for the projection.
distance (float) – It is used only if download_method == “distance_from_address” or “distance_from_point”.
- Returns:
nodes_gdf, edges_gdf – the junction and street segments GeoDataFrames.
- Return type:
Tuple of GeoDataFrames