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.
Any suggestion as to how I may do this while preserving boundary data will be helpful