Hi Martin

You can download the splitted tiles here:
http://snailrun.de/Found_one.zip
http://snailrun.de/Find_three.zip

Thanks, this is very helpful.

I think the problem is that I am missing the case where the same street is in different map tiles when creating mdr20.

I attach a new version of the patch, afraid I will not have time to do any testing or changes to it over the next few days, although I do have high hope of it being an improvement.

Pre-built jar file at: http://files.mkgmap.org.uk/download/49/mkgmap.jar

..Steve

Index: src/uk/me/parabola/imgfmt/app/mdr/Mdr5.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/Mdr5.java	(revision 2164)
+++ src/uk/me/parabola/imgfmt/app/mdr/Mdr5.java	(working copy)
@@ -172,11 +172,12 @@
 		int val = (localCitySize - 1);
 		// String offset is only included for a mapsource index.
 		if (isForDevice()) {
-			val |= 0x10 | 0x40; // not yet, probably refers to mdr17 etc.
+			val |= 0x40; // not known, probably refers to mdr17.
 		} else {
 			val |= 0x04;  // region
 			val |= 0x08; // string
 		}
+		val |= 0x10;
 		val |= 0x100; // mdr20 present
 		return val;
 	}
Index: src/uk/me/parabola/imgfmt/app/mdr/Mdr20.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/Mdr20.java	(revision 2164)
+++ src/uk/me/parabola/imgfmt/app/mdr/Mdr20.java	(working copy)
@@ -88,14 +88,19 @@
 		Mdr5Record lastCity = null;
 		int record = 0;
 		int cityRecord = 0;
+		int lastMapNumber = 0;
 		for (SortKey<Mdr7Record> key : keys) {
 			Mdr7Record street = key.getObject();
 
 			String name = street.getName();
 			Mdr5Record city = street.getCity();
 
+			boolean citySameByName = city.isSameByName(lastCity);
+
+			int mapNumber = city.getMapIndex();
+
 			// Only save a single copy of each street name.
-			if (!name.equals(lastName)) {
+			if (!name.equals(lastName) || !citySameByName || mapNumber != lastMapNumber) {
 				record++;
 
 				streets.add(street);
@@ -103,7 +108,7 @@
 			}
 
 			// The mdr20 value changes for each new city name
-			if (city.isSameByName(lastCity)) {
+			if (citySameByName) {
 				city.setMdr20(cityRecord);
 			} else {
 				// New city name, this marks the start of a new section in mdr20
@@ -111,6 +116,7 @@
 				city.setMdr20(cityRecord);
 				lastCity = city;
 			}
+			lastMapNumber = mapNumber;
 		}
 	}
 
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to