Hi Arndt, Gerd

Sorry - this was me mis-reading the code and is simply fixed.
The assertion failed when there are no polygons in the tile that match
the tag/key.

patch attached

Ticker

On Thu, 2020-02-13 at 16:39 +0000, Ticker Berkin wrote:
> Hi Arndt
> 
> I can reproduce this - it seem to be something related to the
> expression structure.
> 
> Probably it just returned 'false' before, rather than raising the
> exception.
> 
> I'll investigate
> 
> Ticker 
> 
> On Thu, 2020-02-13 at 16:38 +0100, Arndt Röhrig wrote:
> > > Hi Gerd, hi Ticker,
> > > 
> > > now i use is-in-r-4449. Sorry, some mistakes happen without
> > > explanation.
> > > 
> > > 4449 report this:
> > > 
> > > Greets
> > > Arndt
> > > 
> > > 16:24:37,71 - mkgmap .\tools\mkgmap-is-in-r4449 Speiche_Fabrik 
> > > java.lang.AssertionError: invoked the non-augmented instance 
> > > at
> > > uk.me.parabola.mkgmap.osmstyle.function.IsInFunction.calcImpl(Is
> > > c
> _______________________________________________
> mkgmap-dev mailing list
> [email protected]
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Index: src/uk/me/parabola/mkgmap/osmstyle/function/IsInFunction.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/function/IsInFunction.java	(revision 4450)
+++ src/uk/me/parabola/mkgmap/osmstyle/function/IsInFunction.java	(working copy)
@@ -117,10 +117,9 @@
 	public String calcImpl(Element el) {
 		log.info("calcImpl", System.identityHashCode(this), kind, params, el);
 		assert qt != null : "invoked the non-augmented instance";
-	    	resetHasFlags();
-
 		if (qt.isEmpty())
 			return String.valueOf(false);
+		resetHasFlags();
 		try {
 			switch (kind) {
 			case POINT:
@@ -134,7 +133,7 @@
 				break;
 			}
 		} catch (CanStopProcessing e) {}
-		log.info("done", hasIn, hasOn, hasOut);
+		log.info("done", System.identityHashCode(this), hasIn, hasOn, hasOut);
 		return String.valueOf(mapHasFlagsAnswer());
 	}
 
@@ -304,7 +303,17 @@
 			}
 		}
 	}
+    /*
+make above function return boolean depending on it finding something.
+maybe should also respond to ON
 
+in below, delay setting the IN flag until have done the above, because the line could all be ON the inner.
+and use return from above to set IN, assume that when it finds something, it will set IN of OUT etc
+
+for POLY, still need a final check that, even if ON/IN, none of the holes is in this one, so
+we need another check (can we use above not-in-hole...) that takes a point from the hole and
+checks if it is the polyLine
+     */
 	private void doCommonTest(Element el) {
 		List<Coord> polyLine = ((Way)el).getPoints();
 		Area elementBbox = Area.getBBox(polyLine);
@@ -388,10 +397,7 @@
 				}
 			}
 		}
-		if (!matchingPolygons.isEmpty()) {
-			return new ElementQuadTree(elementSaver.getBoundingBox(), matchingPolygons);
-		}
-		return null;
+		return new ElementQuadTree(elementSaver.getBoundingBox(), matchingPolygons);
 	}
 
 	public void unitTestAugment(ElementQuadTree qt) {
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to