joto / osmium

C++/Javascript framework for working with OSM files.
http://wiki.openstreetmap.org/wiki/Osmium
GNU General Public License v3.0
123 stars 31 forks source link

Failure to parse .osh.pbf files with extension .osm.pbf #95

Closed almccon closed 8 years ago

almccon commented 10 years ago

I'm not sure if this is an Osmium error or if the problem is somewhere else.

I am trying to use the osm-history-splitter to cut up the whole planet history file, which I download from http://planet.openstreetmap.org/planet/experimental/.

The full history planet files downloadable there have filenames like history-2014-09-01.osm.pbf. However, osm-history-splitter gives this Osmium error and segfaults:

terminate called after throwing an instance of 'Osmium::OSMFile::FileTypeOSMExpected'

But, if I rename the file history-2014-09-01.osm.pbf to history-2014-09-01.osh.pbf (note the change of .osm to .osh) everything seems to work perfectly.

So, is a problem with the planet.openstreetmap.org server naming its files incorrectly? Should they be named .osh instead of .osm?

Or should Osmium be able to read those files correctly regardless of their file extension?

joto commented 10 years ago

Thats one of those murky OSM areas. The .osh extension was "invented" for Osmium. Osmium was one of the first software to read OSM files with history and needed something to differentiate between OSM files with and without history. But the people creating the history dump don't think it should have a different extension, because it is basically the same format. It is currently unresolved what the best way forward is here. So for the time being your easiest solution is to just rename those files.