Hi Thorsten

Thanks, with that patch it is much better, but I still see
streets where some housenumbers does not have a city assigned.
For example Von-der-Tann-Strasse in Hammelburg and Ingolstadt.
Some housenumbers have the city assigned, others not.

I found a bug where the wrong nodes were being used for the house
numbers. This would tend to push house numbers further along the road
than they should be and once they are pushed off the end they appear
to lose their city too.

The attached patch is an additional patch that should be applied as
well as the previous one (which I will commit anyway).

It seems to fix all the cases that I was using as tests.

..Steve
Index: src/uk/me/parabola/mkgmap/osmstyle/housenumber/HousenumberGenerator.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/housenumber/HousenumberGenerator.java	(revision 2945)
+++ src/uk/me/parabola/mkgmap/osmstyle/housenumber/HousenumberGenerator.java	(revision )
@@ -298,36 +298,43 @@
 			log.info("Numbers:",roadX.getValue());
 			
 			int n = 0;
-			int lastRoutableNodeIndex = -1;
+			int nodeIndex = 0;
+			int lastRoutableNodeIndex = 0;
 			for (Coord p : r.getPoints()) {
-				if (n== 0) {
+				if (n == 0) {
 					assert p instanceof CoordNode; 
 				}
-				
+
-				if (p instanceof CoordNode == false) {
+				// An ordinary point in the road.
+				if (p.getId() == 0) {
 					n++;
 					continue;
 				}
-				
+
-				if (lastRoutableNodeIndex < 0) {
-					lastRoutableNodeIndex=n;
+				// The first time round, this is guaranteed to be a CoordNode
+				if (n == 0) {
+					nodeIndex++;
 					n++;
 					continue;
 				}
 
+				// Now we have a CoordNode and it is not the first one.
 				Numbers numbers = new Numbers();
 				numbers.setNodeNumber(0);
 				numbers.setRnodNumber(lastRoutableNodeIndex);
 			
 				applyNumbers(numbers,leftNumbers,n,true);
 				applyNumbers(numbers,rightNumbers,n,false);
+
+				if (log.isInfoEnabled()) {
-				log.info("Left: ",numbers.getLeftNumberStyle(),numbers.getRnodNumber(),"Start:",numbers.getLeftStart(),"End:",numbers.getLeftEnd(), "Remaining: "+leftNumbers);
-				log.info("Right:",numbers.getRightNumberStyle(),numbers.getRnodNumber(),"Start:",numbers.getRightStart(),"End:",numbers.getRightEnd(), "Remaining: "+rightNumbers);
+					log.info("Left: ",numbers.getLeftNumberStyle(),numbers.getRnodNumber(),"Start:",numbers.getLeftStart(),"End:",numbers.getLeftEnd(), "Remaining: "+leftNumbers);
+					log.info("Right:",numbers.getRightNumberStyle(),numbers.getRnodNumber(),"Start:",numbers.getRightStart(),"End:",numbers.getRightEnd(), "Remaining: "+rightNumbers);
+				}
 				
 				numbersListing.add(numbers);
 				
-				lastRoutableNodeIndex=n;
-				
+				lastRoutableNodeIndex = nodeIndex;
+				nodeIndex++;
 				n++;
 			}
 			
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to