← Back to list

Integrating Overpass Turbo and GeoPandas in My Daily Workflow

“A map does not just chart, it unlocks and formulates meaning; it forms bridges between here and there, between disparate ideas that we did…

Indera Ihsan · 2025-04-11 09:00 · 0 claps · 4.4 min read
#geopandas #overpass-turbo #spatial-analysis #python
Open on Medium ↗

Integrating Overpass Turbo and GeoPandas in My Daily Workflow

“A map does not just chart, it unlocks and formulates meaning; it forms bridges between here and there, between disparate ideas that we did not know were previously connected.” ― Reif Larsen, The Selected Works of T.S. Spivet

Photo by GeoJango Maps on Unsplash

Photo by GeoJango Maps on Unsplash

When working with geospatial data, one of the most powerful and flexible combinations in my toolkit is Overpass Turbo and GeoPandas. Whether I’m exploring urban infrastructure, analyzing Points of Interest (POIs), or just experimenting with public datasets, this duo makes it incredibly easy to fetch and visualize real-world data.

In this post, I’ll walk you through how I use Overpass Turbo’s API to pull location-specific data from OpenStreetMap, and then bring it to life using GeoPandas in Python. It’s a simple but effective workflow that turns raw coordinates into interactive maps and insightful spatial analysis — all without leaving Google Colab.

Utilizing Overpass Turbo to fetch data

Overpass turbo (overpass-turbo.eu) is a web based data mining tool for OpenStreetMap. it is one of the essential tools i used daily to fetch POI data such as Mall, School, and many more. in this example, we’re about to get train station (because i use train to get to the office) and school data from overpass turbo, let’s create a function to get things up. i will be writing my code in google colab.

import requests
import geopandas as gpd
from shapely.geometry import Point, shape

def get_overpass_data(longitude, latitude, tags, radius=10000):
    overpass_url = "http://overpass-api.de/api/interpreter"
    tag_filter = ''.join([f'["{k}"="{v}"]' for k, v in tags.items()])

    query = f"""
    [out:json];
    node{tag_filter}(around:{radius},{latitude},{longitude}); 
    out body;
    """
    response = requests.get(overpass_url, params={'data': query})
    data = response.json()
    elements = data.get('elements', [])
    if not elements:
        return gpd.GeoDataFrame(columns=['name', 'geometry'], geometry='geometry', crs="EPSG:4326")
    names = [elem['tags'].get('name', 'Unnamed') for elem in elements]
    geometries = [Point(elem['lon'], elem['lat']) for elem in elements]

    gdf = gpd.GeoDataFrame({'name': names}, geometry=geometries, crs="EPSG:4326")
    return gdf

okay, let’s give our function a try to fetch a station within 10000 meter from the given latitude and longitude

latitude = -6.57, 
longitude = 106.8
stations = get_overpass_data(longitude, latitude, {"railway": "station"}, radius=10000)
stations.head() 

the return value of the function

the return value of the function

This function queries the Overpass API (which taps into OpenStreetMap data) to find nodes (points like schools, stations, toll gates, etc. in the above example it’s a train station) that match specific ***tags *within a given radius of a location. It returns a GeoDataFrame containing the names and coordinates of the matching locations. we can try different tags, different location and different radius** to get a more varying results. in the example below we will be combining train stations, school, convenience store and toll gate as one dataframe and visualize it using GeoPandas

Now that we’ve fetched our geospatial data from Overpass Turbo, it’s time to visualize it on an interactive map using Folium and GeoPandas’ .explore() function. The code below shows how I combine multiple types of Points of Interest (POIs)—like train stations, schools, toll gates, and convenience stores—into a single map visualization centered around a chosen location.

import folium

# Set the coordinates for our area of interest (Bogor, Indonesia)
latitude = -6.57
longitude = 106.8

# Fetch and label POIs using custom Overpass queries
stations = get_overpass_data(longitude, latitude, {"railway": "station"}, radius=10000) 
stations['poi_type'] = 'train_station'

school = get_overpass_data(longitude, latitude, {"amenity": "school"}, radius=10000) 
school['poi_type'] = 'school'

toll_gates = get_overpass_data(longitude, latitude, {"barrier": "toll_booth"}, radius=10000) 
toll_gates['poi_type'] = 'toll_gate'

retail = get_overpass_data(longitude, latitude, {"shop": "convenience"}, radius=10000) 
retail['poi_type'] = 'retail'

poi_data = pd.concat([stations, school, toll_gates, retail]) 
poi_data = poi_data[poi_data['name'] != 'Unnamed']

Using a custom the function get_overpass_data()we define earlier I query Overpass Turbo for four types of POIs within a 10 km radius. Each result is labeled with a poi_type so we can distinguish them during visualization. I merge all the POI datasets into a single GeoDataFrame and remove generic or missing names to keep the visualization clean.

Creating our interactive map using geopandas.

m = poi_data.explore(
    column='poi_type', 
    tooltip='name', 
    cmap='Accent',
    style_kwds={
        "radius": 6, 
        "fillOpacity": 0.7
    }
)

This is where the magic happens. The .explore() method from GeoPandas generates an interactive Folium map. Here's what each parameter does:

  • column='poi_type': Colors each point by its POI type.
  • tooltip='name': Shows the POI name when you hover.
  • cmap='Accent': Uses a vibrant, distinguishable color palette ideal for categorical data.
  • radius & fillOpacity: Tweak marker size and transparency.

the initial interactive map.

the initial interactive map.

Adding Map Layers for Better Context


folium.TileLayer('Stamen Terrain', attr='google map', control=True).add_to(m)
folium.TileLayer(
    'https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}', 
    control=True, 
    attr='<a href=https://google.com/>Google</a>'
).add_to(m)

folium.LayerControl().add_to(m)

This setup lets me interactively explore different POI categories on a real map — zoom, click, and hover — all inside a Jupyter Notebook or Google Colab. It’s quick, clean, and incredibly powerful for urban planning, site selection, or just spatial storytelling.

you can get the code here in google colab

Now that you’ve seen how powerful Overpass Turbo and GeoPandas can be when used together, here are a few ideas to take your spatial data journey even further:

1. Explore Other POI Categories

You’re not limited to just train stations or retail! Try changing your Overpass filters to fetch:

  • amenity="hospital" for health infrastructure
  • leisure="park" to study green spaces
  • highway="bus_stop" to analyze public transport networks

2. Combine with Demographic or Economic Data

Layer your POIs with datasets like:

  • Population density
  • Land prices
  • School performance

This can help with site selection, urban planning, or socio-economic research.

3. Build a Custom Dashboard

Take it beyond notebooks:

  • Export your analysis to a web map with Folium or Dash
  • Create an automated script to update your POI data regularly
  • Use Streamlit to turn it into a no-code tool for your team or audience

Thanks for sticking around till the end! I hope this walkthrough gave you a clear picture of how I use Overpass Turbo and GeoPandas together to explore spatial data — fetching live POIs, visualizing them interactively, and even doing quick spatial analysis.

If you’re working on anything similar, or if you have ideas to enhance this workflow — I’d genuinely love to hear from you. Your feedback, suggestions, or even questions can help make future content even better.


메타데이터
post_id
463d67d458fc
slug
integrating-overpass-turbo-and-geopandas-in-my-daily-workflow-463d67d458fc
url
https://medium.com/@inderaihsan/integrating-overpass-turbo-and-geopandas-in-my-daily-workflow-463d67d458fc
canonical_url
https://medium.com/@inderaihsan/integrating-overpass-turbo-and-geopandas-in-my-daily-workflow-463d67d458fc
author_url
https://medium.com/@inderaihsan
status
ok
fetched_at
2026-07-24 20:22:33