Opened 14 years ago
Last modified 3 years ago
#6886 closed enhancement
[Patch] Add PBF reading support to JOSM — at Initial Version
| Reported by: | Don-vip | Owned by: | team |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Plugin pbf | Version: | latest |
| Keywords: | pbf | Cc: |
Description
I've written a patch to enhance JOSM in order to read PBF files.
The file format is described on OSM wiki:
http://wiki.openstreetmap.org/wiki/PBF_Format
and widely used, for example on Geofabrik download server:
http://download.geofabrik.de/osm/
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:
https://github.com/scrosby/OSM-binary
This library has a dependence on Google Protobuf library, available here:
http://code.google.com/p/protobuf/
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.


