
Hello WanMil, okay, thanks for the hint. I read it before but did not fully understand it , had to lookup some vocabels ;-) So, the behaiour of contains() is exactly as it is described there. The problem is that we hit this case quite often, because many coords are lying exactly on the way that build the boundary. I'll try to understand how this is solved in ElementQuadTree. Ciao, Gerd
Date: Wed, 11 Jan 2012 20:56:36 +0100 From: wmgcnfg@web.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] Bug in LocationHook?
Besides that, my quadtree works, but it doesn't save as much time as expected, and I found a small bug in the Area.contains() method: If I search for a point that lies exactly on the right most corner or line of the area, contains() doesn't always find it. I thought this is because of rounding errors, but if I got it right, it is simply a wrong test (x + w < y instead of x + w <= y). If you like, I can prepare a small sample to show that. I thought that the result of my implementation of LocationHook should be exactly the same as that from trunk when I make sure that both do only use the same point of a way for searching. In many cases, it was like that, but because of the above error, it sometimes was not. Took me quite a while to track that down ;-)
Have a look on the definition of "insideness" of the Shape interface: http://docs.oracle.com/javase/6/docs/api/java/awt/Shape.html
This gives an explanation of the contains behaviour.
WanMil _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev