uk.me.parabola.mkgmap.combiners
Class GmapsuppBuilder

java.lang.Object
  extended by uk.me.parabola.mkgmap.combiners.GmapsuppBuilder
All Implemented Interfaces:
Combiner

public class GmapsuppBuilder
extends java.lang.Object
implements Combiner

Create the gmapsupp file. There is nothing much special about this file (as far as I know - there's not a public official spec or anything) it is just a regular .img file which is why it works to rename a single .img file and send it to the device.

Effectively we just 'unzip' the constituent .img files and then 'zip' them back into the gmapsupp.img file.

In addition we need to create and add the TDB file, if we don't already have one.

Author:
Steve Ratcliffe

Constructor Summary
GmapsuppBuilder()
           
 
Method Summary
 void init(CommandArgs args)
          Initialise with the command line arguments.
 void onFinish()
          The complete map set has been processed.
 void onMapEnd(FileInfo finfo)
          This is called when the map is complete.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GmapsuppBuilder

public GmapsuppBuilder()
Method Detail

init

public void init(CommandArgs args)
Description copied from interface: Combiner
Initialise with the command line arguments. This is called after all the command line arguments have been processed, but before any calls to the Combiner.onMapEnd(uk.me.parabola.mkgmap.combiners.FileInfo) methods.

Specified by:
init in interface Combiner
Parameters:
args - The command line arguments.

onMapEnd

public void onMapEnd(FileInfo finfo)
This is called when the map is complete. We collect information about the map to be used in the TDB file and for preparing the gmapsupp file.

Specified by:
onMapEnd in interface Combiner
Parameters:
finfo - Information about the img file.

onFinish

public void onFinish()
The complete map set has been processed. Creates the gmapsupp file. This is done by stepping through each img file, reading all the sub files and copying them into the gmapsupp file.

Specified by:
onFinish in interface Combiner