[GIS] ogr2ogr: convert osm.pbf to SpatiaLite – error messages

gdalogr2ogropenstreetmapqgis

I have downloaded a .osm.pbf file from extract.bbbike.org and am interested in all highways/line features of my downloaded pbf-file.

I also changed the osmconf.ini to choose wich TAGs I would like to get (that they are not all put together in the "other_tags" field). This seems to work.

Therefore I would like to convert the .osm.pbf file to a spatialite db, to use the data in QGIS, convert them to a shapefile and so on.

I entered the following command:

 ogr2ogr -f "SQLite" -dsco SPATIALITE=YES targetsqlite.db bbbikefile.osm.pbf

This seems to work, I can use the output and it looks good, but I get some error messages which I am worried about:

enter image description here

Do you have an idea how I could remove these error messages (for example change my command), or aren't they problematic?

I am just interested in the highways/roads, so I don't care about polygons (or points), I guess the polygon errors are not important then? What about the requsted DLL errors 126?

Also, why do I receive some lines as "lines", and some as "multilinestrings", which are overlapping usually: the "multilinestrings" are also included in the "lines", so I guess I can ignore the "multilinestrings"?

Best Answer

The openstreetmap data model is not very strict in a GIS sense, and some editors do not detect topological errors before uploading.

So you may get lines with only a single node, or the same node twice in a line.

Polygons are created from closed OSM ways, or relations of type multipolygon. These may contain inner rings. This usually works, but sometimes creates warnings when converting to polygons. For example, self-intersecting may or may not be tolerated by the software. Or inner rings that are not inside the outer ring etc.

It might be as well a problem of the data extraction. Some software takes the whole geometry if one node (or one part of an outer or inner ring) is inside the bounding box, others may not. As an alternative to bbbike.org, you could try the Geofabrik extract covering the same area, and see if the warning persists.

Since you are interested in highways, you can safely ignore polygon errors, unless the importer stops at that point.

For the multilinestrings: These can be route relations consisting of lines. The members are already part of the lines table. Route relations make sense if you want to lable bicycle or hiking trails, or want to let the user prefer waymarked trails over unmarked ways.

Related Question