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)