[Patch] Add PBF reading support to JOSM
|Reported by:||Don-vip||Owned by:||team|
Description (last modified by bastiK)
I've written a patch to enhance JOSM in order to read PBF files.
The file format is described on OSM wiki:
and widely used, for example on Geofabrik download server:
The idea behind this patch is to create two new classes, PbfImporter and PbfReader, on the same model as OsmImporter and OsmReader. This leads to create a common abstract class for those two *Reader, AbstractReader.
The PBF "parsing" is done using osmpbf, the reference Java implementation (the one that powers Osmosis), available here:
This library has a dependence on Google Protobuf library, available here:
Two things are needed in Google library:
- the library itself, protobuf-java, composed of 37 manually written Java files, and one generated file
- the protobuf compiler (protoc), that generates one Java file in this library, and two files in osmpbf. The compiler is available as a Windows executable on Google code, or can be built from source.
Please find the patch adding this PBF support. I don't have updated the build.xml because I don't know how you would integrate these additional dependences.
One more thing: the PBF has been designed for future scalability, so all IDs are 64 bit-long. This causes a lot of impacted files in JOSM due to the int->long conversion for changeset IDs.