Tag Archives: shell script

Use Overpass API to get OSM data

Overpass API

Have you ever needed very specific data from openstreetmap and don’t want to download the whole state or country? The solution is Overpass API.

The Overpass API (formerly known as OSM Server Side Scripting, or OSM3S) is a read-only API that serves up custom selected parts of the OSM map data. It acts as a database over the web: the client sends a query to the API and gets back the data set that corresponds to the query.

http://wiki.openstreetmap.org/wiki/Overpass_API

We are going to try the Overpass QL as query language. The whole query source code is divided in statements. We set the type of element that we want: node, way, relation or area. and then filter by tag. Like this

node[name="Foo"];
way[name="Foo"];
rel[name="Foo"];
area[name="Foo"];

Continue reading