Lesson 2: Mapping the City from OpenStreetMap¶
Planning question: What exists on the ground?
Before planning anything new, you need a base map of what is already there. You will download buildings, streets, parks and amenities for Indiranagar and combine them into a layered map.
What you will learn¶
- Download any OSM layer by its tags
- Turn polygons into points with centroids
- Build a layered figure-ground map
- Do a quick open-space-per-person check
- Save all layers to one GeoPackage
Key concepts¶
- Tags: OSM describes features with key=value pairs, such as
leisure=park - Layers: maps are built from the bottom up
- Data quality: OSM is free but uneven, so always check it
What you will make¶
A figure-ground map of Indiranagar showing buildings, streets, parks and amenities.
| Packages | osmnx, geopandas, matplotlib |
| Data | OpenStreetMap |
| Time | 30 to 45 minutes |
Try it yourself¶
The end of the notebook includes these exercises:
- Compare Jayanagar with Indiranagar.
- Add bus stations or libraries.
- Add water bodies with
natural=water.
Enjoying the course? Support it with a star on GitHub.