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

2009-06-16 Thread Thilo Hannemann
Hi Mark, Am 16.06.2009 um 08:33 schrieb Mark Burton: Recently, Coord.distance() was replaced with a much speedier implementation because a lot of cpu cycles were being wasted there. The newer function appears to be accurate enough for our purposes. The DP code contains another distance

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

2009-06-16 Thread Mark Burton
Hi Thilo, The DP code contains another distance calculation. What you must calculate there is the distance of one point to a line. The Coord.distance() is used in that formula, but I do not understand the formula itself. Maybe it's some genius trick to simplify the calculation, but

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

2009-06-16 Thread Thilo Hannemann
Hi Mark, Am 16.06.2009 um 09:18 schrieb Mark Burton: At the distances we're (mostly) interested in, the curvature of the earth's surface has a tiny effect (much less than the effect of hills valleys) so I guess (hope) that leaving out that factor is OK. The curvature may have a tiny

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

2009-06-16 Thread Mark Burton
Hi Thilo, At the distances we're (mostly) interested in, the curvature of the earth's surface has a tiny effect (much less than the effect of hills valleys) so I guess (hope) that leaving out that factor is OK. The curvature may have a tiny effect, but nonetheless you should

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

2009-06-16 Thread Mark Burton
On Tue, 16 Jun 2009 17:19:21 +0100 Mark Burton ma...@ordern.com wrote: In the example above, I would argue that taking the sqrt and division outside of the loop doesn't make the code harder to understand and may yield some speedup. Well, a quick test showed a barely perceptible gain so may

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

2009-06-16 Thread Marco Certelli
--- Mar 16/6/09, Mark Burton ma...@ordern.com ha scritto: Da: Mark Burton ma...@ordern.com Oggetto: Re: [mkgmap-dev] Overview map: tiny patch/review series A: mkgmap-dev@lists.mkgmap.org.uk Data: Martedì 16 giugno 2009, 18:19 Hi Thilo, At the distances we're (mostly) interested

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

2009-06-16 Thread Elrond
On Tue, Jun 16, 2009 at 07:58:24AM +0200, Thilo Hannemann wrote: Hi Elrond, [...] The problem of distorted polygons does not only appear in the overview map, it appears at all zoom levels. [...] Hi, Okay, about the DP code, I have some speculation, why it performs bad. It's a variation on

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

2009-06-16 Thread Thilo Hannemann
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

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

2009-06-15 Thread Elrond
Hi developers, Probably many have already noticed, that the overview map (used to contain the polygons for selecting tiles in mapsource) isn't perfect. Often the polygons are much too large, or sometimes too small. They also feel like having a bias (at least for me). I have tried to fix this.

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

2009-06-15 Thread Thilo Hannemann
Hi Elrond, there seem to be some problems with the simplification right now. But instead of simply de-activating the simplification I think we should debug the code. Of course it's fine to de-activate it for debugging :) The problem of distorted polygons does not only appear in the