Subway Route Data Extraction with Overpass API: A Step-by-Step Guide | by Amanda Iglesias Moreno | Sep, 2024


Simplify Geodata Extraction from OpenStreetMaps via the Overpass API

Towards Data Science
Folium Visualization of the Subway Network in Hamburg (Image Created by the Author)

Open Street Maps is one of the most important data sources regarding geographic information. Many of the data available on the platform can help us conduct a wide range of analyses, but how do we easily download the data for our analyses? The Overpass API allows access to all the data available on the platform through customized queries. This API serves as the foundation for the popular Python library OSMnx and, thanks to its personalized queries, it allows us to obtain more data than the Python library, which is limited to the data most frequently extracted from Open Street Maps.

In this article, we will use the API to obtain the subway routes located in Hamburg. Using these routes, we will create a NetworkX graph, which we will later on visualize using an interactive visualization in Folium. The data extracted in this article could be used for multiple analyses, such as evaluating the distance of various households to a subway station to predict their monetary value.

As we can see, geographic data is very valuable for a wide range of analyses. Therefore, knowing tools to easily extract this data is absolutely necessary. Let’s start with the article!

Recent Articles

Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here