OpenStreetMap – the biggest geodata source

Every day OpenStreetMap project gains popularity, new users and new mappers all over the world. Driven by community OpenStreetMap nowadays became one of the biggest geodata sources. All of us already used to utilize the OSM based maps, which are easy to integrate, easy to style and relatively inexpensive. Moreover, there are already a lot of services, for example, routing, geocoding and others, that are based on some OSM data. However, a lot of geodata added to OSM is still underrated and used only for the generation of visual map tiles.

What kind of geodata can I find in the OSM database?

OpenStreetMap contains an enormous amount of data – stating from administrative boundaries and main streets to benches and single trees. Often it’s not only visible information but all available data about the place. For example, the number of floors of a building, websites, opening hours and other data.

We recommend you to start with the OpenStreetMap website to find out what kind of data is available for your use-case and region:

Zoom the map in to the region

Select “Query features” tool to get the geodata present on the map

Click on a map and explore found features

How good is the quality of the OSM geodata?

Working with the OSM database you need to understand that the data added by thousands of different people with different backgrounds and knowledge. That’s why sometime it may happen that different tags or even sometimes different data types were used to map places. So it may require additional post-processing of the OSM data. On the other hand, the community works hard to unify tags, data formats, and increase the quality of the data. So the OSM geodata quality constantly increases.

How can I get the geodata from the OSM database?

Even if OpenStreetMap is open and free, it could be tricky to get the data without expertise. Here are some ways how to get data from OSM. Depending on requirements as well as the amount of time and money you plan to spend, some of them may fit better your conditions.

Places API

It’s the simplest way, but the most restricted one. There are a number of companies that provide an API to query amenities and points of interest. This could be the perfect solution if you are simply looking for places and some information about them.

Check our Places API. We offer queries for points of interest and amenities of different types for a specified bounding box. Together with that, we transfer all OSM tags added to a place.

Pros 1. Easy Cons 1. Cost money

2. Restricted

Overpass API

Another way to get geodata from OSM is Overpass API. It’s a more complicated way, while it requires a knowledge of Overpass QL query language. However, thanks to the community there are a lot of examples and guidelines on the web.

The API acts as a database – gets queries and returns data. You can create simple queries or complicated ones, with conditions and geo-operations. With the help of Overpass Turbo – web-based frontend, you can run Overpass API queries and get results on an interactive map or as a text.

At the moment there are several Overpass API instances provided by the community, so you can start for free and without registration. But all of them have restrictions and limits.

Geoapify offers a commercial instance of Overpass API. Contact us to get access to it.

Pros 1. Flexible and powerful

2. Community support

3. Free for small volumes Cons

2. Commercial solution required for big volumes 1. Requires a knowledge of Overpass QL query language2. Commercial solution required for big volumes

OSM data extracts

Probably the most complicated but the most powerful and free way to use OSM as a geodata source.

As OpenStreetMap is an open-source project, you can always download the most recent data extracts from a website. By downloading the data you need to keep in mind that the whole planet database is about 49 GB (PBF file, Feb. 2020) and it may make sense to use parts of it – separate continents or countries.

There are different services that provide access to OSM data:

Planet OSM – complete copies of the OSM database

Geofabrik.de and BBBike.org – regional extracts for OSM database

The downloaded file can be processed with a variety of tools or can be imported into a SQL database:

Osmosis – converting OSM files among different formats and databases

Osm2pgsql – importing OSM files into PostGIS database

Pros 1. Flexible and powerful

2. Free for small and big volumes Cons 1. Requires expertise in databases and SQL

2. Big data extracts require decent servers (min 32GB RAM, 500-700GB SSD)

3. The data import may take up to several days

Custom data sets

If fast results and data quality are important for you you can order a custom geodata set from specialists.

Geoapify offers a service to create custom geodata sets. Just describe your needs – what kind of data, data region, data format, and we make the work done for you! Contact us for more information.