A simple yet powerful Google Colab notebook to download geographic data for specific 'ways' (like roads, paths, or building outlines) from the OpenStreetMap (OSM) API and save the coordinates of all constituent points (nodes) into a clean, easy-to-use CSV file.
This tool runs entirely in your browser, so no local Python installation is required. It's designed to be accessible for everyone, including users with no programming experience.
- Runs in Your Browser: No setup needed, thanks to Google Colab.
- Easy to Use: Just edit a single list in the code cell to input the OSM Way IDs you want to process.
- Batch Processing: Download data for multiple ways in a single run.
- Descriptive Filenaming: Automatically names the output CSV file using all the way's tags and its unique ID (e.g.,
highway_path-name_Some_Trail_12345_nodes.csv). - Informative Output: See progress and information about each way as the script runs.
Follow these steps to get your CSV files.
- Go to www.openstreetmap.org.
- Search for a location and find the road, path, park, or building you are interested in.
- Click on the feature. The details will appear in a panel on the left.
- Make sure it says "Way" at the top to confirm you've selected the right type of object.
- The Way ID is the large number shown right below the word "Way".
- Click the "Run in Google Colab" button at the top of this README.
- The notebook will open. Find the code cell titled "Process OpenStreetMap Way IDs and Generate CSV Files".
- Locate the list named
way_ids_to_processat the very top of that cell. - Edit the list to include the Way ID(s) you found. Make sure each ID is a string (inside quotes
"") and separated by a comma.
Example:
- Run the code cell by clicking the "play" button next to it or by pressing
Shift+Enter. - The script will now fetch the data and create your files, printing its progress below the cell.
- Once the script finishes, look at the left sidebar in Google Colab and click the folder icon 📁.
- Your new
.csvfiles will be listed there. - Click the three dots (⋮) next to each filename and choose Download to save it to your computer.