logo separator

[mkgmap-dev] gmapi reader?

From Steve Ratcliffe steve at parabola.me.uk on Sun Jan 28 21:41:54 GMT 2018

Hi Gerd

I would use a new implementation of FileSystem, named GmapFS
or similar, which would go in package .imgfmt.sys
Then add the trait FileSystem.openFS() which will return the
correct ImgFS or GmapFS.

Then your code would be roughly:

	fs = FileSystem.openFS(demReuseDir); // Will return ImgFS or GmapFS
	chan = fs.open(demFilename, "r")

	// read DEM header to check if it can be used.

To copy without having to read it into memory, you can use
FileCopier.

I could implement GmapFS as I was already thinking of doing that so
that we would be able to convert gmapi format to gmapsupp.

Steve

> Hi Steve, I hope you can help me out here.
> 
> I've implemented a new option --x-dem-reuse which allows to copy the DEM file
> from an older map.
> My idea is that the option specifies the path to either
> 1) a gmapsupp or
> 2) a gmap folder  or
> 3) a directory containing *.img files
> from a previous run with similar dem-dist option and tile boundaries.
> 
> If given, mkgmap tries to find the matching *.DEM in any of these formats,
> checks if the content matches the wanted boundary and dem-dist option and - if ok -
> uses the existing file instead of doing the DEM calculations again.
> 
> At the moment I have some working quick+dirty code (see attached patch).
> I assume the new code in MapBuilder should go somewhere in package uk.me.parabola.imgfmt.app,
> maybe a new class ImgFinder or so? Or do we already have such code in mkgmap?
> What I also don't like is that it copies the data from the existing file into memory.
> Is there already an easy way to avoid that?
> 
> Gerd
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> 



More information about the mkgmap-dev mailing list