On Tue, 19 May 2009, Mark Burton wrote:

Well, that's a good question. As distance() mostly gets called to
determine which of a bunch of points is nearest, it probably doesn't
matter at all that the result is slightly "wrong".

Really? In that case you could as well change the metric from Euclidean to something more simple like the Manhattan metric:

  dist = abs(lat2-lat1) + costab[lat1] * abs(lon2-lon1)

where costab is a table lookup for cos(). This will still find a point that is close, but it is not guaranteed to be the same as with the Euclidean metric. Would that matter?


-Wolfgang
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to