2

I'm currently trying to setup an offline Nominatim geocoder VM and I only need to have access high level data (countries, states and cities).

Is there an OSM high level dataset (.pdf package) available?
A lighter version of Planet.pbf would be perfect for my needs (ref: geofabrik).

Thanks

3 Answers 3

1

The .pbf files from Geofabrik always contain all data of a region. You have to filter them yourself. Filtering with osmfilter before importing into the database will speed up your task a lot. For osm2pgsql, buildings, landuse polygons and route relations take up a lot of processing time.

For boundaries, there are alternatives at Seeking administrative boundaries for various countries?

For cities, maybe http://www.geonames.org/ can be helpful for you.

Downloads can be found at http://download.geonames.org/export/dump/

1

By 'high level', do you mean at less detail, a low zoom level, that would have simplified polygons of countries, states, and cities? If so, then no, there aren't any high level datasets of OSM available.

For your and other use cases, the cultural vectors (1:10m) from naturalearthdataare a suitable replacement for you.

Many web maps (the default map on osm.org for example) which use OpenStreetMap data at higher zoom levels where great detail is necessary but instead use natural earth data for lower zoom levels.

2
  • Actually, by less details, I mean without the POI, without the roads, and other granular information. I am looking to import the complete pbf package for north america but I would also like to have access to country and cities for the entire world (without having to inject 700gb (planet.pbf) of data in my DB). Commented Jun 3, 2014 at 17:45
  • Filtering with osmfilter before importing into the database will speed up your task a lot.
    – AndreJ
    Commented Jun 4, 2014 at 3:53
0

Assuming you are using Postgres you can download the 8 Geofabrik regional Extracts and use Osmosis and Osm2Pgsql to load a data subset of each region except for the North America dataset, then load the complete North America dataset

I have read about, but not encountered issues relating to the same OSM ID existing in two different datasets (on the edges of the extract) and the database insert failing due to the unique primary key constraints in Postgres

Alternatively, you can load the planet file then delete the data not needed. Osm2pgsql ends up with 4 tables planet_osm_line which contains all the ways), planet_osm_road which is a road only subset of planet_osm_line (which you could drop), planet_osm_points (pois which you could just drop) and plamet_osm_polygon which has all the polygon data. You could delete delete all entries in lines and polygons and only keep what you needed based on the tags in the database and a bounding box/poly outside North America. (Use PostGis ST_Contains, ie, is Not Contained in the bounding box)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.