Hi WanMil,

In the Geofabrik finland.osm.pbf there are a few Russian place=*. Some
of these carry addr:country=RUS.

I am invoking mkgmap (among others) with the following options:

--country-abbr=FIN --country-name=Finland --location-autofill=nearest

I am not using any bounds information. You can see the full invocation
in http://www.polkupyoraily.net/osm/files/osm2img.sh

In the tile for southeast Finland (63240007.osm.pbf), many if not all
places are now displaying as RUS instead of FIN. I added addr:country=FI
to Rääkkylä, and it now correctly shows FIN. Before that change, all
place=* in that tile had either no addr:country or had addr:country=RU.

Is it so that --location-autofill=nearest somehow overrides
--country-abbr and --country-name? I would expect all place=* that lack
addr:country to get an implicit addr:country=FI when I specify
--country-abbr=FIN. In that way, the worst thing that would happen is
that my map of Finland would have some Russian places (which are located
very close to the border and are lacking addr:country=RU) incorrectly
displaying as FIN instead of RUS.

Best regards,

        Marko

Hi Marko,

the following happens:
1. the style rules are applied, so all elements (places in this case) with addr:country set are applied with the country information.
2. the nearest search starts which means:
2.1 all places with complete country/region information are put to a "known places list" 2.2 for all places with incomplete country/region information the nearest place from the "known places list" is retrieved and its information is copied.

The nearest search does not have a max distance. So if one place in the tile is tagged with addr:country=RU and no other country information is provided all places in the tile will be tagged with country RU. Maybe it would make sense to define such a maximum distance?

While looking into the source code to write how it works I've probably found a problem so that some places are not put to the "known places list".

Could you try it if it improves the behaviour for you?

WanMil

Index: src/uk/me/parabola/mkgmap/build/Locator.java
===================================================================
--- src/uk/me/parabola/mkgmap/build/Locator.java	(revision 2063)
+++ src/uk/me/parabola/mkgmap/build/Locator.java	(working copy)
@@ -63,6 +63,11 @@
 		if(p.getCountry() != null)
 			p.setCountry(normalizeCountry(p.getCountry()));
 
+		if(p.getCountry() != null && p.getRegion() != null && p.getCity() == null)
+		{		
+			p.setCity(p.getName());
+		}
+
 		resolveIsInInfo(p); // Pre-process the is_in field
 
 		if(p.getCity() != null)
@@ -172,12 +177,6 @@
 			return;
 		}
 		
-		if(p.getCountry() != null && p.getRegion() != null && p.getCity() == null)
-		{		
-			p.setCity(p.getName());
-			return;
-		}
-
 		if(p.getIsIn() != null)
 		{	
 			String[] cityList = p.getIsIn().split(",");
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to