7

I just starting to work with raw-OSM data, so maybe my question is a very basic one.

When I download OSM data from Geofabrik I never get the same coverage of the polygons as in the rendered raster OSM data - at least for many areas.

In the screenshot below you see the rendered OSM data as background and the polygons of the downloaded raw-OSM data above. For some areas I get the polygons (the light-red colored area, transparent to see the rendered OSM data below), but you see e.g. the forest in the middle of the sceenshot and the farmland in the lower part which are missing in the raw-OSM data. Even the boundary between forest and agricultural area is not available (e.g. as Polyline in the .osm.pbf file).

Screenshot: Rendered OSM data (background) and raw-OSM data (only Polygons)

Being used to work with shapefiles, I would assume that all areal features like land use are provided as polygons. But this is not the case obviously. The alternative -which I do not beliefe to be true - would be that the raw data have gaps in it.

Can someone explain what I am doing wrong?

Thanks


some technical details: I tried different data sets (meaning: different areas) and data formats (shapefiles, osm.pbf) but always have the same issue. I also tried to download OSM data via the OpenStreetMap plugin in QGIS.

3 Answers 3

5

If you want to have the same look as the background tiles, you have to use the same toolchain.

That requires to have a Postgis database filled with osm2pgsql.

The Openstreetmap plugin of QGIS has some limitations in the correct creation of multipolygons (although much better than the old plugin had some yers ago), and the ogr2ogr data provider used by "Add vector layer" has too.

The shapefiles from geofabrik are only a subset of the OSM database, with attention to roads. It might be that some kind of strange forest multipolygons are dropped there.

See this example for relation 3541951 missing in geofabrik shapefile detmold-regbez-latest.shp.zip:

enter image description here

Tagged as landuse=forest, but not in the landuse or natural layer.

6
  • Andre, thank`s for you answer. I will try to use Postgis and osm2pgsql.
    – Tim
    Jun 27, 2014 at 10:49
  • ...it is a more general request. I am not particularly interested in the area of my screenshot above.
    – Tim
    Jun 27, 2014 at 10:50
  • Thanks for this example, I've relayed it to a person I think could resolve the issue. Jun 27, 2014 at 11:20
  • So... yes, "the converter doesn't support multipolyons at all". So Tim will have to generate shape files by himself, or use PostGIS. Jun 27, 2014 at 12:32
  • That's not good for Geofabrik...
    – AndreJ
    Jun 27, 2014 at 12:36
1

First, you don't work with raw OSM data, unless you are editing it. Never. It isn't worth the trouble.

The reason you don't see some polygons and boundaries is that they are mapped with relations. Specifically, with multipolygons and boundary relations, which are quite the same. They provide a way to draw complex polygons, with holes. Most preprocessing software — osm2pgsql, osmium, osmosis etc. — has code to construct proper polygons from relations. It is not a simple task.

For QGIS, I recommend downloading pre-processed shape files. Its OSM plugin has became obsolete and broken years ago. There are extracts at Geofabrik, also check MapZen's for city areas. You can convert those yourself: for example, with ogr2ogr, or with osm2pgsql and an intermediate PostGIS database (more control, but more complex).

6
  • the question says that the data from geofabrik has the problem.
    – neogeomat
    Jun 26, 2014 at 13:17
  • 1
    That data doesn't. Geofabrik separates features by layers (it is very clear when looking at their archives' contents), so the author might have forgotten to load some of them. Jun 26, 2014 at 13:20
  • No, I haven`t forget to load some data. If I drag and drop the osm.pbf file into qgis and select all five vector layers (points, lines, multilinestrings, multipolygons, and other_relations) I still have some gaps. The same holds true if I load all shapefile layers from the zip-compressed files from Geofabrik.
    – Tim
    Jun 26, 2014 at 14:21
  • See this answer for details on loading osm files. I still cannot believe geofabrik's shapefiles do not include all forest multipolygons. Can you point at the coordinates you've made your screenshot at? Jun 26, 2014 at 20:26
  • 1
    @IljaZverev: See the example in my answer.
    – AndreJ
    Jun 27, 2014 at 11:10
1

the fact that land use is provided as polygon has nothing to do with the presence/absence of gaps between those polygons. Don't forget that OSM is created by crowd sourcing and that different users may contribute to the same area. depending on the definition and the understanding of the mappers, polygons boundaries might not end in a complete coverage of a given area.

However, missing polygons is not normal. Have checked that you are using both the "landuse" and the "natural" layers? This could explain that you don't have the forests.

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.