logo separator

[mkgmap-dev] Poor man's line draw order - mkgmap dropping extended type lines ?

From Mark Burton markb at ordern.com on Wed Oct 14 14:40:09 BST 2009

Hello Ivan,

> I think I found where my extended-type lines disappear. They are simply not
> taken into account when estimating subdivision size, i.e:
> 
> MapArea.java, lines 389-394
> 
> private void addSize(MapElement p, int[] sizes, int kind) {
> 
> ->        if(p.hasExtendedType()) {
> ->            // not applicable for elements with extended types
> ->            return;
> ->        }
> 
> So subdivisions end up too big (and are not drawn correctly) if there are a
> lot of extended-type elements. I commented out above lines in MapArea.java,
> rebuilt mkgmap (r1274) and seems to work, i.e. extended lines are no longer
> dropped in i.e. MapSource.
> 
> I am not sure if I am breaking anything else, so please, somebody who
> understands the code and implications more, please check this.

Extended type elements are not stored in the subdivision in the same
manner as the non-extended elements so it is not appropriate to take
their sizes into account in the same way as the elements with
non-extended types.

However, there could well be some limit to the amount of extended type
elements that a subdivision has. The offsets and sizes are 32 bit but
that doesn't mean to say you can have huge amounts of those elements in
a single subdivision.

I could introduce some threshold that would cause a subdivision to be
split if the extended type elements are larger than that.

Cheers,

Mark



More information about the mkgmap-dev mailing list