patch Interface Locatable and Kd-tree

Hi Steve, I plan to use a KD tree in the house number code. I noticed that the existing Kd-tree implementation in MapPointKdTtree is only usable with MapPoint instances, although it only uses the getLocation() method . I think this should be replaced using general interface Locatable() with method getLocation() and and general Kd-Tree implementaion for classes that implement the Locatable interface. The attached patch shows what I mean. What do you think about it? Do you see better names or packages for this? Gerd

On 26/03/15 19:03, Gerd Petermann wrote:
I think this should be replaced using general interface Locatable() with method getLocation() and and general Kd-Tree implementaion for classes that implement the Locatable interface. The attached patch shows what I mean.
What do you think about it?
Yes sounds a great idea. You could also make it generic so that casts are not needed as in the attached partial patch. ..Steve

Hi Steve, yes, much better. Will use it like this. Gerd Date: Thu, 26 Mar 2015 22:38:00 +0000 From: steve@parabola.me.uk To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] patch Interface Locatable and Kd-tree On 26/03/15 19:03, Gerd Petermann wrote:
I think this should be replaced using general interface Locatable() with method getLocation() and and general Kd-Tree implementaion for classes that implement the Locatable interface. The attached patch shows what I mean.
What do you think about it?
Yes sounds a great idea. You could also make it generic so that casts are not needed as in the attached partial patch. ..Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gert, I think GPSMapEdit may help for this (File -> Map Properties -> select tab Statistics), but it doesn't load TYP files. AFAIK mkgmap doesn't write any stats regarding the number of written types, but it seems easy to do something like the style statistics. I guess you think about something like a table showing 4 columns Point/Line/Shape Type/Subtype Count Desc from TYP ---------------------------------------------------------- point 0x2806 8 place of worship point 0x2807 0 Megalithic monument line 0x00 1211 cycling route line 0x2F 4 ? where a count of 0 means the type is defined in the TYP file but was not written and a question mark in Desc means the type is not defined in the TYP file. I have no idea how much work it would be to write such a table, because I don't know the mkgmap data structures for the typ file. It should be easy enough when the typ compiler has the needed infos. Gerd From: thesurveyor@wolke7.net To: mkgmap-dev@lists.mkgmap.org.uk Date: Wed, 1 Apr 2015 16:01:28 +0200 Subject: [mkgmap-dev] how to check style files vs. typfile Hi, just a simple question to the experts. How do you check if a used type in the style files (lines, points, ...) is available in the typ-file (e.g. basemap.typ or basemap.txt) ? And maybe in the other direction too? Many thanks in advance. Regards, Gert _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (3)
-
Gerd Petermann
-
Steve Ratcliffe
-
thesurveyor@wolke7.net