Hi Martin

unfortunately I have deleted all the files, but I have created them again with 
the geofabrik-datas from today.
Search for the Engelbertusstraße works:
http://snailrun.de/59.zip
Didn't work:
http://snailrun.de/56789.zip

Thanks very much. I believe I found the problem (or at least a problem).
Could you try out the attached patch please?

In the mdr20 section the streets were being sorted not just by city
name, but also by map number. So it was looking like this:

APPLE STREET
ZOO ROAD
BEE ROAD
ZEBRA ROAD

with Apple and Bee in the same city but different maps, instead of like this:

APPLE STREET
BEE ROAD
ZEBRA ROAD
ZOO ROAD

I previously suggested that the city being in three tiles rather than
two might have been a problem, but I believe that was not particularly
relevant.
I think that some streets will be un-findable whenever a city falls
across more than one tile.

How can I read the the different mdr-tables?

In the display project (code at http://svn.mkgmap.org.uk/display/trunk)
there are a number of utilities that display various aspects of
the file.

test.display.MdrDisplay
        displays the structure of an MDR file
        This is reliable since it prints out exactly what is in the file,
        but the interpretation of mdr files that are contained within
        gmapsup.img files may be incomplete or incorrect.

        Pass the name of the file that is or contains an MDR file.
        Followed by numbers if you want to limit the sections that are
        printed.

test.display.MdrCheck
        reads an MDR file and the associated .img files that it was
        created from.  It cross checks the data between the index and the
        img files and prints in a form that shows the meaning rather than
        the literal layout of the file.
        It can be mis-leading since I just add to it when needed and some
        changes I have made to mkgmap are not reflected in this code.
        So some of the errors it prints are not errors.

        Pass the name of a file (an MDR file, xxx_mdr.img or gmapsupp.img)
        Followed by options: --print 5,7 to just print sections 5 and 7
             --errors to just print the errors.

..Steve
Index: src/uk/me/parabola/imgfmt/app/mdr/Mdr20.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/mdr/Mdr20.java	(revision 2028)
+++ src/uk/me/parabola/imgfmt/app/mdr/Mdr20.java	(revision )
@@ -17,7 +17,8 @@
 import java.util.Collections;
 import java.util.List;
 
-import uk.me.parabola.imgfmt.app.srt.IntegerSortKey;
+import uk.me.parabola.imgfmt.app.srt.MultiSortKey;
+import uk.me.parabola.imgfmt.app.srt.Sort;
 import uk.me.parabola.imgfmt.app.srt.SortKey;
 
 /**
@@ -46,9 +47,10 @@
 	 * Also have to set the record number of the first record in this section
 	 * on the city.
 	 *
-	 * @param inStreets The list of streets from mdr7.
+	 * @param inStreets The list of streets from mdr7, must have Mdr7.index set.
 	 */
 	public void buildFromStreets(List<Mdr7Record> inStreets) {
+		Sort sort = getConfig().getSort();
 
 		List<SortKey<Mdr7Record>> keys = new ArrayList<SortKey<Mdr7Record>>();
 		for (Mdr7Record s : inStreets) {
@@ -56,10 +58,18 @@
 			if (city == null)
 				continue;
 
+			String name = city.getName();
+			if (name == null || name.isEmpty())
+				assert false;
+
 			// We are sorting the streets, but we are sorting primarily on the
 			// city name associated with the street, then on the street name.
-			// Since the cities are already sorted, we can use the city index.
-			SortKey<Mdr7Record> key = new IntegerSortKey<Mdr7Record>(s, city.getGlobalCityIndex(), s.getIndex());
+			// The streets are already sorted, with the getIndex() method revealing the sort order
+			SortKey<Mdr7Record> cityKey = sort.createSortKey(s, city.getName());
+			SortKey<Mdr7Record> regionKey = sort.createSortKey(null, city.getRegionName());
+			SortKey<Mdr7Record> countryStreetKey = sort.createSortKey(null, city.getCountryName(), s.getIndex());
+			SortKey<Mdr7Record> key = new MultiSortKey<Mdr7Record>(cityKey, regionKey, countryStreetKey);
+
 			keys.add(key);
 		}
 		Collections.sort(keys);
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to