1

I was required to download my countries road data from OpenStreet Maps for a project I'm currently working on. For this I used the OSMnx Library. However, as my RAM was insufficient to download the entire country's data at once I decided to download the data district-wise by writing the following function on python.

# Defining Map Extraction Function
def map_extract(district):
    import osmnx as ox # importing OSMnx Library
    G = ox.graph_from_place(district, network_type='walk') # Extracting the district street network graph
    G_projected = ox.project_graph(G)

ox.save_load.save_graph_shapefile(G_projected, filename=district, folder=None, encoding='utf-8') # Saving the street network graph as an ESRI Shapefile

After downloading the shapefiles and loading them in QGIS I realized that the road data on the district boundaries were missing.

The roads connecting the two districts are missing in the dataset

Any suggestion as to how I may do this while preserving boundary data will be helpful

  • 1
    Do you realize that you only download the walkways, not all road data? Both are probably different in OSM. If you need all road data, remove network_type='walk' part. – Kadir Şahbaz Jul 24 at 10:37
  • Oh I see. I will try that. – Nandula Jul 24 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.