[OSM-dev] Planet file with preprocessed lines/polygons

Ilya Zverev ilya at zverev.info
Fri May 12 17:28:18 UTC 2017

The answer hugely depends on your task. There is no such preprocessed geojson planet dump, because it would be huge and a pain to use.

Most people use libosmium or pyosmium to scan through the features in an OSM file. You will get geometries and even reconstructed multipolygons. See http://osmcode.org/

Then there are QA Tiles, a whole planet split into small tiles in the MVT format. People use them to build validation and QA services, like counting buildings and finding geometry errors. Links and a few examples are here: https://www.mapbox.com/blog/osm-qa-tiles/

To get billions of GeoJSON objects for every feature in the planet, you can use osm2pgsql to import the planet dump into a PostgreSQL+PostGIS database. It will make three tables for points, lines and polygons. After that, pgsql can give you geometries and tags in geojson format: you would have to make three queries and assemble the result into one big geojson file. Or process these on the spot. The drawback is that you would need half a terabyte for that.


> 12 мая 2017 г., в 19:18, Christoph Lingg <christoph at lingg.eu> написал(а):
> Hello,
> when it comes to read raw OSM dumps it's quite straightforward to parse nodes: their geometry properties can be read alongside with their tags. When it comes to linestrings and relations it is more complicated to access their geometry: the geometry of referenced nodes needs to be combined into lines and polygons. Also one needs to decide which linestrings/relations are actually lines and which are areas.
> I know how this can be done but I am wondering if there are preprocessed datasets around that have geometries already precomputed. That would make sense to me as a lot of people face the sample problem and this step is quite resource intense.
> A huge file containing all osm items as geojson would be my dreamcase. Does this exist?
> Thank you for your time and your help!
> Christoph Lingg
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/dev

More information about the dev mailing list