logo separator

[mkgmap-dev] Overview map: tiny patch/review series

From Thilo Hannemann thannema at gmx.de on Tue Jun 16 22:24:31 BST 2009

Am 16.06.2009 um 18:33 schrieb Marco Certelli:

> Just speculation:
>
> I've a and b that defines a line. I look for the distance between a  
> point p and the line.
>
> Given the triangle p-a-b where p is the vertex and a-b is the  
> "base", the area of the triangle can be calculated from the lenght  
> of its 3 sides (pa, pb, ab).
>
> After that, since the area is also base x height / 2 we can  
> calculate the height = area / base * 2
>
> well, the height is exactly the distance of the point p from the  
> line a-b
>
> Maybe...

You are right. It is Heron's formula. And from what I see the  
implementation is correct. Even the coordinates on the sphere are no  
problem, because the formula itself doesn't use lat and lon and we can  
assume the triangle to be flat locally. So I think the implementation  
is quite clever indeed.

Okay.

But that still doesn't explain why the map looks better if I reduce  
the error distance setting for the Douglas-Peucker filter. The error  
should be already invisible at the default setting.

Regards
Thilo



More information about the mkgmap-dev mailing list