Thanks for the very specific examples, it should be easy to track down from 
them.

I'm on a train at the moment, but my initial guess is that regionOffset in 
LocatorConfig should be set. But there must be more to it than that.


_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
I looked a little bit more into it by adding debug info in Locator.java (see attached patch). I tried different values of location-autofill (-1 thru 4) and it did not change anything.

At that point everything looks fine. Where else could the problem happen?

2011/03/02 16:15:09 FINE (Locator): C:\OSM\maps\Test.osm: Processing Ackworth 2011/03/02 16:15:09 FINE (Locator): C:\OSM\maps\Test.osm: is_in=WARREN,IOWA,IOWA,IA,USA
2011/03/02 16:15:09 FINE (Locator): C:\OSM\maps\Test.osm:   using format 3
2011/03/02 16:15:09 FINE (Locator): C:\OSM\maps\Test.osm: region: IOWA, country: UNITED STATES 2011/03/02 16:15:09 FINE (Locator): C:\OSM\maps\Test.osm: region: IOWA, country: UNITED STATES



Index: src/uk/me/parabola/mkgmap/build/Locator.java
===================================================================
--- src/uk/me/parabola/mkgmap/build/Locator.java        (revision 1877)
+++ src/uk/me/parabola/mkgmap/build/Locator.java        (working copy)
@@ -55,11 +55,13 @@
 import java.util.Collection;
 import java.util.List;
 
+import uk.me.parabola.log.Logger;
 import uk.me.parabola.mkgmap.general.MapPoint;
 import uk.me.parabola.mkgmap.general.MapPointFastFindMap;
 import uk.me.parabola.mkgmap.general.MapPointMultiMap;
 
 public class Locator {
+       private static final Logger log = Logger.getLogger(Locator.class);
 
        private final MapPointFastFindMap cityMap                               
        = new MapPointFastFindMap();
        private final MapPointMultiMap          fuzzyCityMap                    
= new MapPointMultiMap();
@@ -73,6 +75,8 @@
 
        public void addLocation(MapPoint p) 
        {
+               log.debug("Processing "+p.getName());
+               
                resolveIsInInfo(p); // Pre-process the is_in field
                
                if(autoFillLevel < 1 &&  p.getCity() == null)
@@ -80,7 +84,7 @@
                        // Without auto-fill city name is the name of the tag
                        p.setCity(p.getName());
                }
-               
+       
                if(p.getCity() != null)
                {
                        cityMap.put(p.getCity(), p);
@@ -96,6 +100,7 @@
                        placesMap.add(p);               
                }
                        
+               log.debug("  region: " + p.getRegion() + ", country: " + 
p.getCountry());
        }
 
                        
@@ -162,7 +167,7 @@
                {       
                        String[] cityList = p.getIsIn().split(",");
                        
-                       //System.out.println(p.getIsIn());
+                       log.debug("  is_in=" + p.getIsIn());
 
                        // is_in content is not well defined so we try our best 
to get some info out of it
                        // Format 1 popular in Germany: 
"County,State,Country,Continent"
@@ -179,6 +184,7 @@
                                if(cityList.length > offset)
                                        
p.setRegion(cityList[cityList.length-(offset+1)].trim());
 
+                               log.debug("  using format 1" );
                        }
 
                        // Format 2 other way round: 
"Continent,Country,State,County"   
@@ -192,9 +198,11 @@
 
                                if(cityList.length > offset)
                                        p.setRegion(cityList[offset].trim());
+
+                               log.debug("  using format 2" );
                        }       
 
-                       // Format like this "County,State,Country"
+                       // Format 3  like this "County,State,Country"
 
                        if(p.getCountry() == null && cityList.length > 0)
                        {
@@ -211,6 +219,8 @@
                                        if(cityList.length > offset)
                                
p.setRegion(cityList[cityList.length-(offset+1)].trim());       
                                }
+
+                               log.debug("  using format 3" );
                        }
                }
 
@@ -222,6 +232,8 @@
                        if(!isOpenGeoDBCountry(p.getCountry()))
                                p.setCity(p.getName());
                }
+               
+               log.debug("  region: " + p.getRegion() + ", country: " + 
p.getCountry());
        }
        
        public MapPoint findNextPoint(MapPoint p)
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to