I would like to convert a shp file to map file. I know should use these steps:

shp -> osm -> pbf -> map

For step 1 I use a python script : ogr2osm.py

For step 2 I use osmosis, but I get an ERROR:

SEVERE: Thread for task 1-rx failed 
Node -13963 does not have a version attribute as OSM 0.6 
are required to have. Is this a 0.5 file?

Converting OSM to PBF is probably not necessary, most tools that can read PBFs can also read OSM XML.

If you do need to read the file with osmosis, the issue here is that ogr2osm by default generates files that can be loaded in JOSM and merged with existing OSM data. These files have no timestamp or version attributes as well as having negative IDs, while osmosis requires timestamps, versions, and positive IDs.

If you want these attributes in the output XML you can use the options --positive-id, --add-version, and --add-option. You have to be careful with the resulting output file. It is incompatible with existing OSM data, or other files generated with ogr2osm.

  • add it but:missing bounding box information in input data. – Ali Apr 13 '14 at 6:00

The .osm file you create with the script does not have version/user/timestamp attributes. Osmosis does not like that.

I guess you have to look for other ways to get your map file. I'm not sure how you want to do the last step anyway.


Have you tried this?


You may need one step in Postgre ...


The OSM wiki lists some more tools for converting shape files to .osm. Maybe try another one?

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.