2

According to this question Some OSM tags in polygons and some in points - how to bring them together I used osmconvert --all-to-nodes to extract the central points of all ways and relations.

I used a osm.pbf as input:

osmconvert osm.pbf --all-to-nodes -o=osm_node.pbf

...or with increasing id:

osmconvert osm.gpkg --all-to-nodes --object-type-offset=10^15  -o=osm_node.pbf

and translated the resulting osm_node.pbf to GPKG with ogr2ogr.

The result is:

The RAW osm_node.gpkg:enter image description here

The "all-to-nodes" osm.pbf enter image description here

The resulting GPKG should have a lot more nodes as the raw data has. But it hasn't...

What am I doing wrong?

5
  • How many features do you find from .pbf with ogrinfo -al -so osm.pbf? Do you know if --all_to_nodes transfers all tags unaltered to the new points? – user30184 May 24 '19 at 6:49
  • Hm the result of ogrinfo -al -so osm.pbf for both files (RAW and Nodes) is: Feature Count: -1 for every geometry and relation... – MAP May 24 '19 at 7:15
  • osmconvert cannot process GPKG files, you are doing something wrong or your examples are wrong. – bugmenot123 May 24 '19 at 7:34
  • I convert the PBF to GPKG with ogr2org AFTER using osmconvert – MAP May 24 '19 at 7:38
  • Ok, GDAL does not support quick feature count with "summary only" because the only way to get if is to read the whole file. Only nodes with tags defined in osmconf.ini svn.osgeo.org/gdal/trunk/gdal/data/osmconf.ini are considered as points by GDAL. I wonder if "all_to_nodes" keeps the tags as they are. For example tag "highway" should go to the point layer as well. – user30184 May 24 '19 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.