logo separator

[mkgmap-dev] About PBF format

From Richard Hansen rhansen at bbn.com on Wed Jan 18 22:35:22 GMT 2012

On 2012-01-18 17:18, David wrote:
> Hello,
>
> I meet an error with PBF files produced by splitter and used with mkgmap
> : "Error at line 1, col 1 Bad file format... it occurs with
> Ireland.osm.pbf from geofabrik.de. (mkgmap v2172 & splitter v200)

If I understand correctly, this means that mkgmap is trying to read the 
pbf files as xml files.  In my experience, this is because the pbf jars 
(protobuf.jar and osmpbf.jar) were unavailable during build and/or runtime.

>
> Is there a way to convert PBF file produced by splitter into OSM format
> (or how can I used PBF files produced by splitter with mkgmap) ? Should
> I add an option in command line ?

There are a few options:

   * tell splitter to output xml (--output=xml)
   * use osmconvert or osmosis to convert the .pbf produced by splitter 
to something else
   * rebuild mkgmap with pbf support and make sure the jars are 
available during runtime

To get mkgmap to build and run with pbf support, I did the following:
   1.  modified resources/MANIFEST.MF and changed osmprotobuf.jar to 
osmpbf.jar (I'm guessing it changed names at some point in the past)
   2.  modified external.properties to change the protobuf.jar and 
osmprotobuf.jar variables to point to where I had protobuf.jar and 
osmpbf.jar installed
   3.  after mkgmap was done building, I copied protobuf.jar and 
osmpbf.jar to the directory containing the built mkgmap.jar

I used the protobuf.jar and osmpbf.jar from the splitter svn repository.

Hope this helps,
Richard



More information about the mkgmap-dev mailing list