I am using osmconvert to clip countries/regions from the planet.osm.pbf file. My end goal is creating a multimodal transport network, using (mostly) osm data. Mainly for academic purposes. To speed up this creation process, I am splitting up the planet file into countries/regions to create this network parallel. Recently, I have started to realize that I am missing quite some ways in the extracted/clipped files. For example, openstreetmap.org shows a near complete and connected railway system for tanzania. In my extracted osm.pbf for tanzania (either using a bbox or a .poly file), I am missing quite some railway segments. The same issue is the case for the download.geofabrik.de extracts (at least in the case for Tanzania, where I started to realize this issue). Perhaps good to emphasize: I am not missing these segments around the borders (this is ofcourse already addressed in the osmconvert wiki), it is really in the middle of the bbox/.poly file. The osmconvert code I am using is:
Did anyone have this problem with osmconvert before? And more importantly, found a solution to the problem? Thanks! asked 21 Jun '18, 09:04 ElcoK
showing 5 of 8
show 3 more comments
|
Without knowing exactly what you're doing it may be difficult for people to comment. Could you provide a bit more detail and some examples?
If you are saying that the Geofabrik download for Tanzania is missing data, I would be interested in a way ID so I can check.
Hi Frederik,
One example is Way: 396139210
At least, I don't see it in the file I've downloaded today (and yesterday) from geofabrik. It use to be there, and it is also on openstreetmap.org
If you open the lines from tanzania-latest.osm.pbf in QGIS and overlay this with the openstreetmap, you'll see that (for instance in Dar Es Salaam) also many roads are missing.
Must be an issue with QGIS then, since the way is definitely present in tanzania-latest.osm.pbf. Perhaps whatever logic QGIS applies is stumped by the fact that your way is part of relation 1183489 which is (at the time of writing with v99 being current) erroneously tagged as highway=residential?
I've narrowed down the problem now. The reason why my confusion started was because some part of the railway in TZA (not the way I mentioned above) was missing (this is apparently deleted by someone, even though it is still there).
So the problem is not in the osmconvert clip (which is good to know!), but apparently something goes wrong in the ogr2ogr drivers when trying to directly load in the data (either through python directly or QGIS, as they were missing the quite often the same elements).
After extracting all line features from the pbf file by using the following code in python, I miss quite a lot of segments.
My default ogr2ogr osm => geojson places railway in other tags for lines. It may be worth checking say against geojson for the same feature using overpass-turbo.
Hmm interesting point. As this is now turning into a osgeo/gdal question (why different results between ogr2ogr command line and python import), I will post that question at stackoverflow. Thanks for the help!
... which is this one, just for reference: https://gis.stackexchange.com/questions/287193/different-results-ogr2ogr-command-line-vs-osgeo-import-ogr-with-reading-osm-data