Commit: r961: Improve city detection in non-geodb countries.

Version 961 was commited by steve on 2009-03-02 21:32:49 +0000 (Mon, 02 Mar 2009) BRANCH: poi Improve city detection in non-geodb countries. - Bernhard Heibler plus some formatting etc fixes

Hi Steve, thanks for checking in this patch. Unfortunately I detected one more problem. It looks like the Nuvi doesn't like your new sorting of the city list. I must admit that I like your new sorting much cleaner then the old one. But it looks like the old sorting of the TreeMap was just by luck the right one. The nuvi seams to run a binary search on this list and fails to find some cities if the sort order is not perfect. It also leaves away the country info for such cities it can not find in the city list. I compared the old and the new sorting and played around with the Locale setting of the Collator but didn't found a setting that matches. The new sort order seams to cut out whitespaces in names. The old one sorted space before A which was ok for the nuvi. The Germany Umlauts like Ä where sorted after Z now Ä cames after A which seams also not right for the nuvi. It would be interesting which function TreeMap uses to sort strings ... Thanks Berni. svn commit schrieb:
Version 961 was commited by steve on 2009-03-02 21:32:49 +0000 (Mon, 02 Mar 2009) BRANCH: poi
Improve city detection in non-geodb countries.
- Bernhard Heibler
plus some formatting etc fixes _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

On Mon, Mar 02, 2009 at 11:02:18PM +0100, Bernhard Heibler wrote:
Hi Steve,
thanks for checking in this patch. Unfortunately I detected one more problem. It looks like the Nuvi doesn't like your new sorting of the city list. I must admit that I like your new sorting much cleaner then the old one.
Well that is interesting as I have seen files that are sorted just like that. There is probably some flag to be set. Try the attached patch. It should be as before with Ä after Z. ..Steve

Hi Steve, here is a quick workaround for the sorting problem. Looks like the String compareTo functions provides the right sorting. Patch also contains change to the help for --add-pois-to-areas option suggested by Clinton Gladstone. Berni.
Hi Steve,
thanks for checking in this patch. Unfortunately I detected one more problem. It looks like the Nuvi doesn't like your new sorting of the city list. I must admit that I like your new sorting much cleaner then the old one. But it looks like the old sorting of the TreeMap was just by luck the right one. The nuvi seams to run a binary search on this list and fails to find some cities if the sort order is not perfect. It also leaves away the country info for such cities it can not find in the city list. I compared the old and the new sorting and played around with the Locale setting of the Collator but didn't found a setting that matches.
The new sort order seams to cut out whitespaces in names. The old one sorted space before A which was ok for the nuvi. The Germany Umlauts like Ä where sorted after Z now Ä cames after A which seams also not right for the nuvi.
It would be interesting which function TreeMap uses to sort strings ...
Thanks Berni.
svn commit schrieb:
Version 961 was commited by steve on 2009-03-02 21:32:49 +0000 (Mon, 02 Mar 2009) BRANCH: poi
Improve city detection in non-geodb countries.
- Bernhard Heibler
plus some formatting etc fixes _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Index: src/uk/me/parabola/imgfmt/app/lbl/PlacesFile.java =================================================================== --- src/uk/me/parabola/imgfmt/app/lbl/PlacesFile.java (revision 961) +++ src/uk/me/parabola/imgfmt/app/lbl/PlacesFile.java (working copy) @@ -175,11 +175,15 @@ Collections.sort(cityList, new Comparator<CitySort>() { public int compare(CitySort o1, CitySort o2) { - return o1.getKey().compareTo(o2.getKey()); + return o1.getKey().getSourceString().compareTo(o2.getKey().getSourceString()); + //return o1.getKey().compareTo(o2.getKey()); } }); for (CitySort cs: cityList) + { + //System.out.println(cs.getKey().getSourceString()); cs.getCity().setIndex(index++); + } } Zip createZip(String code) { Index: resources/help/en/options =================================================================== --- resources/help/en/options (revision 961) +++ resources/help/en/options (working copy) @@ -127,9 +127,9 @@ can be specified with this option. --add-pois-to-areas - Generate a POI for each area. The POIs are created after the style - is applied and only for polygon types that have a reasonable point - equivalent. + Generate a POI for each area. The POIs inherit the tags of the area + polygon, and are resolved according to the rules in the points style + file. --tdbfile Write a .tdb file.

On Mon, Mar 02, 2009 at 11:23:47PM +0100, Bernhard Heibler wrote:
here is a quick workaround for the sorting problem. Looks like the String compareTo functions provides the right sorting. Patch also contains change to the help for --add-pois-to-areas option suggested by Clinton Gladstone.
Thanks. Of course I forgot to attach the patch in my last email. But it was also comparing the strings directly. ..Steve

Hi Steve, your patch solves my problem. I would suggest to commit the simple city string compare to the poi branch. Thanks Berni. Steve Ratcliffe schrieb:
On Mon, Mar 02, 2009 at 11:23:47PM +0100, Bernhard Heibler wrote:
here is a quick workaround for the sorting problem. Looks like the String compareTo functions provides the right sorting. Patch also contains change to the help for --add-pois-to-areas option suggested by Clinton Gladstone.
Thanks. Of course I forgot to attach the patch in my last email. But it was also comparing the strings directly.
..Steve
------------------------------------------------------------------------
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

The new sort order seams to cut out whitespaces in names. The old one sorted space before A which was ok for the nuvi. The Germany Umlauts like Ä where sorted after Z now Ä cames after A which seams also not right for the nuvi.
It would be interesting which function TreeMap uses to sort strings ... See http://libgarmin.wiki.sourceforge.net/Contribute In the img file there could be a subfile .SRT. I dont know much of this, but maybe this is is the definition for sorting and had to be delivered with other locales.
Also there has to be some definition, which accented chars are replaced by which non-accented chars. If I search the name Altomünster, then I can type Altomunster at the etrex keyboard and it will be found.
participants (4)
-
Bernhard Heibler
-
Johann Gail
-
Steve Ratcliffe
-
svn commit