[mkgmap-dev] [Patch v3] LocationHook with new Quadtree
From WanMil wmgcnfg at web.de on Thu Jan 12 21:26:50 GMT 2012
Hi Gerd, some ideas and questions: * BoundaryQuadTree.Node.add always performs a costly intersect of the area, also if the area is completely within the bbox. Maybe it's better first to check if the bbox contains the area (or area.getBounds()). * I don't understand the following part in Node.add: --- // optimization: don't add equal areas, only add the tags // we test only against the last element because that is likely // to match if (numNodes > 0 && a.equals(nodes.get(numNodes-1))){ addMissingTags(nodes.get(numNodes-1).tags, bTags); return; } --- a is an area and nodes.get returns a NodeElem so equals will always be false. I think you want to compare to nodes.get(..).area but I do not understand that either. Why should two areas be equal? * LocationHook.mkgmapTagsArray starts with an empty string element. I don't like that. * for (int i = 12; i >= 1; --i){ if (elem.getTag(mkgmapTagsArray[i] ) != null) res |= (1 << i); } => for (int i = 0; i mkgmapTagsArray.length; i++) { if (elem.getTag(mkgmapTagsArray[i] ) != null) res |= (1 << i); } Counting down is quite unusual and should only be done if there is a real reason for it. * I don't understand why you need a merge() method. Could you explain what you are doing in this method and why it's required? WanMil > Hi, > > now complete and based on r2167. > > Gerd > > http://gis.638310.n2.nabble.com/file/n7181669/locationHook_speedup_v3.patch > locationHook_speedup_v3.patch > > -- > View this message in context: http://gis.638310.n2.nabble.com/Patch-v3-LocationHook-with-new-Quadtree-tp7181669p7181669.html > Sent from the Mkgmap Development mailing list archive at Nabble.com. > _______________________________________________ > mkgmap-dev mailing list > mkgmap-dev at lists.mkgmap.org.uk > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
- Previous message: [mkgmap-dev] [Patch v3] LocationHook with new Quadtree
- Next message: [mkgmap-dev] [Patch v3] LocationHook with new Quadtree
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the mkgmap-dev mailing list