logo separator

[mkgmap-dev] [Patch v1] improve LinePreparer to reduce img size

From Gerd Petermann gpetermann_muenchen at hotmail.com on Sun Jul 17 15:48:05 BST 2016

Hi Nick,

nwillink wrote
> As a matter of interest how long does a delta need to be for it to be
> treated as a special case?

This depends on the number of bits which are used.
The typical case with a coastline polygon is that we have a lot of very
small
delta values and one or two large values for the straight lines.
The unpatched algo uses these large values to calculate the needed number 
of bits (e.g. 8), the patch implements an iterative search which decreases
the number 
of bits and tries if the resulting bit stream is shorter. 
Each value that cannot be represented with e.g. 7 bits needs the trick.
If only one value is stored with the trick, and we have to store 50 values,
we have 50 * 8 = 400 bits with the old and 49 * 7 + 1 * (7+7) = 357 bits for
the trick.
So, the iteration would continue with 6 bits,  maybe 5 bits and so on until
too many values are encoded with the trick (or the the large values are
encoeded with too many bits)
and the bit stream length increases again.

I hope this makes it a bit clearer?

Gerd



--
View this message in context: http://gis.19327.n5.nabble.com/Patch-v1-improve-LinePreparer-to-reduce-img-size-tp5878545p5878568.html
Sent from the Mkgmap Development mailing list archive at Nabble.com.


More information about the mkgmap-dev mailing list