On 21/10/09 11:58, Clinton Gladstone wrote:
On Wed, Oct 21, 2009 at 12:32 AM, Steve Ratcliffe<[email protected]>  wrote:
If an individual map has more than 16 regions then the transfer fails
for that file.  It doesn't appear to make any difference if there are
other maps selected or not.  I modified mkgmap to limit to 16 regions
per file, and have a complete map of Germany that appears to work.

Did you commit this or do you have a patch with this modification? If
so, I will attempt to confirm.

No I can't commit as it just re-assigns cities to random regions.

I had backed it out, but I've just re-created the patch I hope, which is attached.

Oh, I suppose I should confess that I've only checked that it
transfers from MapSource without crashing.  I've not actually looked
at the map on a GPS unit ;)

..Steve
Index: src/uk/me/parabola/imgfmt/app/lbl/LBLFileReader.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/lbl/LBLFileReader.java	(revision 1283)
+++ src/uk/me/parabola/imgfmt/app/lbl/LBLFileReader.java	Wed Oct 21 12:17:55 BST 2009
@@ -162,6 +162,8 @@
 				region.setLabel(label);
 
 				regions.put(index, region);
+				if (index == 16)
+					break;
 			}
 
 			index++;
@@ -192,7 +194,7 @@
 
 			City city;
 			if ((info & 0x4000) == 0) {
-				Region region = regions.get(info & 0x3fff);
+				Region region = regions.get(((info & 0x3fff) % 16) + 1);
 				city = new City(region);
 			} else {
 				Country country = countries.get(info & 0x3fff);
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to