logo separator

[mkgmap-dev] Putting the DP code under the microscope

From Johann Gail johann.gail at gmx.de on Wed Jun 17 19:09:39 BST 2009

>
>> Not sure, but is the i-- on line 93 erroneous? As i will be decremented
>> at the end of the loop anyway, it seems to me that the extra decrement
>> will give rise to the possibility that a Coord won't be tested to see
>> if it's a CoordNode and so it will get zapped if it's not outside the
>> error tolerance? Do we care?
>
> I vote for "bug" here. I've removed the "i--" on line 93 and I see no 
> problems when compiling a map.
>
The original code was from me.
This additional i-- was some sort of optimization. Example:

Line with 10 points
Point 5 is a node. So the segment between 5 and 10 gets straightened. 
Afterwards I would test point 4. But between point 4 and 5 is only a 
straight line, so it doesn't make sense to test them. I can continue 
with segment 3 to 5.

But you are right. If point 4 is a CoordNode then the endpoint should 
not be zapped. So it is a small bug, but will probably not help at the 
overview map. Well watched. Please commit that change.

Regards,
Johann






More information about the mkgmap-dev mailing list