Hi

It appears to be the housenumber block count patch.
I've posted a previous version, and I've attached the most
up-to-date version of it.

This is good, since previously I had no proof that it did anything
useful (cgpsmapper maps do not seem to set it).

There is an unresolved issue, in that it assumes that the routing
level is always 0 which may not be true any more.

@Gerd Do I remember right that you fixed routing so that it would
work even when the resolution was not 24? Could you comment on the
patch?

..Steve

I used the prebuild mkgmap.jars from mkgmap.org, so that shouldn't be that
problem.

Which options did you use the generate the *.img file?

I used now this as smallest option:
mkgmap --latin1 --bounds=bounds --location-autofill=bounds,is_in,nearest 
--housenumbers --route --net --index *.osm.pbf

And with this, I run into the problem of the missing city again :(

Either it's a jar not bundled with mkgmap, some options, my self generated
bounds files or else I have no idea :(

   Thorsten



Index: src/uk/me/parabola/imgfmt/app/trergn/Polyline.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/uk/me/parabola/imgfmt/app/trergn/Polyline.java	(revision 2931)
+++ src/uk/me/parabola/imgfmt/app/trergn/Polyline.java	(revision )
@@ -277,4 +277,14 @@
 	public int getLong() {
 		return getSubdiv().getLongitude() + (getDeltaLong() << getSubdiv().getShift());
 	}
+
+	public int getNodeCount() {
+		int idx = 0;
+		int count = 0;
+		for (Coord co : points) {
+			if (idx++ > 0 && co.getId() > 0)
+				count++;
+		}
+		return count;
+	}
 }
Index: src/uk/me/parabola/imgfmt/app/net/RoadDef.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/uk/me/parabola/imgfmt/app/net/RoadDef.java	(revision 2931)
+++ src/uk/me/parabola/imgfmt/app/net/RoadDef.java	(revision )
@@ -144,6 +144,7 @@
 	private final long id;
 	private final String name;
 	private List<Numbers> numbersList;
+	private int nodeCount;
 
 	public RoadDef(long id, String name) {
 		this.id = id;
@@ -220,8 +221,11 @@
 		writeLevelDivs(writer, maxlevel);
 
 		if((netFlags & NET_FLAG_ADDRINFO) != 0) {
-			writer.put((byte)0); // unknown (nearly always zero)
+			nodeCount--;
+			writer.put((byte) (nodeCount & 0xff)); // lo bits of node count
+
 			int code = 0xe8;     // zip and city present
+			code |= ((nodeCount >> 8) & 0x3); // top bits of node count
 			if(city == null)
 				code |= 0x10; // no city
 			if(zip == null)
@@ -229,7 +233,7 @@
 			if (numbers != null) {
 				code &= ~0xc0;
 				if (numbers.fetchBitStream().getLength() > 255)
-					code |= 1;
+					code |= 0x40;
 			}
 			writer.put((byte)code);
 			if(zip != null) {
@@ -353,6 +357,11 @@
 		if (s > 0)
 			l.get(s-1).getLine().setLastSegment(false);
 		l.add(new RoadIndex(pl));
+
+		// XXX needs to be the lowest level, which might not always be zero in the future
+		if (level == 0) {
+			nodeCount += pl.getNodeCount();
+		}
 	}
 
 	private int getMaxZoomLevel() {
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to