I've used ogr2osm command line tool to convert shapefile to .osm file while doing some editings in QGIS. The problem is after this convert, the updated OSM includes no feature and the attribute table is empty too. But using JOSM I can see data and attribute table. What is wrong with the OSM data? Is it possible that 'geometry' column has been deleted during the converting process or maybe'topology' missing?

python ogr2osm.py city_lines.shp

Also, the volume of the changed data decreases to 70MB from 2GB too!

  • Can you add the command line you used? github.com/pnorman/ogr2osm lists a lot of parameters.
    – AndreJ
    Sep 4 '18 at 15:45
  • @AndreJ I used the simple command without any parameters as: 'python ogr2osm.py city_lines.shp'. I also need this OSM to use in OSRM for route finding but it can not find any route with current data. Sep 5 '18 at 2:40
  • The routing will not work because the vertices shared by two streets on a junction might not get a unique node number. Maybe related: gis.stackexchange.com/questions/166916/…
    – AndreJ
    Sep 5 '18 at 5:38
  • Thanks @AndreJ , I've looked at that question before. But what about not showing data in QGIS? Sep 5 '18 at 6:07
  • If you use Add Vector Layer to load the OSM data, you get only the fields specified in the osm config file. Try the QuickOSM plugin, which is able to import all fields.
    – AndreJ
    Sep 5 '18 at 9:56

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.