Hi Gerd

I've been tearing my hair out over this one.

With the test data supplied, the SubDivision structure in the main
output .img file is incorrect. Just changing how areas are split (ie
relaxing the constraint that bounds are exactly representable at the
zoom/shift level) stops the crash, so this is what I've done in the
attached patch.

Sometime soon I'll try and work out when/where it goes wrong but I've
been looking in so many places, thinking I'd tracked down the problem,
only to find no difference, that I want to give up for a while.

Best wishes
Ticker


On Fri, 2016-12-02 at 15:49 +0100, Arndt Röhrig wrote:
> Hi,
> Thank you all for the support!
> 
> Best regaards
> 
> Ticker Berkin <rwb-mkg...@jagit.co.uk> hat am 2. Dezember 2016 um
> 15:22 geschrieben:
> 
> 
> I'll have a look. I didn't intentionally change extended type
> behaviour, but shapes will end up in different subdivisions with the
> option applied
> 
> Ticker
> 
> 
> On Fri, 2016-12-02 at 07:09 -0700, Gerd Petermann wrote:
> I've got some more test data from Arndt, I've reproduced the
> assertion, here
> is the test data:
> http://files.mkgmap.org.uk/download/316/test.zip
> 
> The problem seems to be caused by the new 
> --order-by-decreasing-area option, if I remove that from the options
> file
> the problem is gone.
> 
> @Ticker: Do you have time to analyse it? I assume the problem is that
> we set
> a flag like "extended type points exist" and later remove the
> corresponding
> data. Does that ring a bell?
> 
> Gerd
> 
> Arndt Röhrig wrote
> &lt;!DOCTYPE html&gt;
> 
> 
> Hello everybody, i use mkgmap r3706. It run 2 times. The first one
> makes
> the img-files. The second one makes the mdr/mdrx files. The first
> step
> works fine, without error-messages, but the second step produces an
> error
> message and crashes: &#34;Exception in thread &#34;main&#34;
> java.lang.AssertionError: Invalid label offset found 1315595
> &#160;&#160;&#160;&#160;&#160;&#160;&#160; at
> uk.me.parabola.imgfmt.app.lbl.LBLFileReader.fetchLabel(LBLFileReade
> r.
> java:87) &#160;&#160;&#160;&#160;&#160;&#160;&#160; at
> uk.me.parabola.imgfmt.app.trergn.RGNFileReader.fetchPointsCommon(RG
> NF
> ileReader.java:123) &#160;&#160;&#160;&#160;&#160;&#160;&#160; at
> uk.me.parabola.imgfmt.app.trergn.RGNFileReader.pointsForSubdiv(RGNF
> il
> eReader.java:84) &#160;&#160;&#160;&#160;&#160;&#160;&#160; at
> uk.me.parabola.imgfmt.app.map.MapReader.pointsForLevel(MapReader.ja
> va
> :119) &#160;&#160;&#160;&#160;&#160;&#160;&#160; at
> uk.me.parabola.mkgmap.combiners.MdrBuilder.addPoints(MdrBuilder.jav
> a: 273)
> &#160;&#160;&#160;&#160;&#160;&#160;&#160; at
> uk.me.parabola.mkgmap.combiners.MdrBuilder.onMapEnd(MdrBuilder.java
> :1 78)
> &#160;&#160;&#160;&#160;&#160;&#160;&#160; at
> uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:600)
> &#160;&#160;&#160;&#160;&#160;&#160;&#160; at
> uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.
> ja
> va:128) &#160;&#160;&#160;&#160;&#160;&#160;&#160; at
> uk.me.parabola.mkgmap.main.Main.mainStart(Main.java:135)
> &#160;&#160;&#160;&#160;&#160;&#160;&#160; at
> uk.me.parabola.mkgmap.main.Main.main(Main.java:106)&#34;
> &#160;&#160;
> &#160;&#160;&#160; &#160; &#160;&#160; &#160;&#160;&#160; &#160;
> &#160;&#160; &#160;&#160;&#160; &#160; When i use mkgmap 3702 an
> error
> message at the first step appears, the second step works fine:
> &#34;SCHWERWIEGEND (ShapeMergeFilter):
> ..\Splitter\88000004.osm.pbf:
> ignoring shape w ith id 364926659 and type 0x13 at resolution 24,
> it has 4
> points and has an empt y area&#34; The OSM-Data is
> &#34;nordrhein-westfalen.osm.pbf&#34;. An other map
> &#34;Kanaran&#34;
> works fine, without error. Whats the reason for this and what can i
> do?
> Best regards Arndt 
> 
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev@.org
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> 
> 
> 
> 
> --
> View this message in context: http://gis.19327.n8.nabble.com/Problem-
> with-r3706-tp5886790p5886799.html
> Sent from the Mkgmap Development mailing list archive at Nabble.com.
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> _______________________________________________mkgmap-dev mailing
> list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Index: src/uk/me/parabola/mkgmap/build/MapArea.java
===================================================================
--- src/uk/me/parabola/mkgmap/build/MapArea.java	(revision 3716)
+++ src/uk/me/parabola/mkgmap/build/MapArea.java	(working copy)
@@ -204,7 +204,23 @@
 	 * @return An array of the new MapArea's or null if can't split.
 	 */
 	public MapArea[] split(int nx, int ny, int resolution, Area bounds, boolean orderByDecreasingArea) {
+/*
 		int resolutionShift = orderByDecreasingArea ? (24 - resolution) : 0;
+Sometimes getting a corrupt subDivision section in the generated map when align to the zoom level
+(or the linkage has gone wrong). Reading back the map to make an index crashes because logic that
+traverses the SubDivisions to gather [Ind]Points tries to interpret some arbitary data as a SubDivision.
+
+The SubDivision flags hasPolylines/hasPolygons can go wrong during generation because these elements
+might all get filtered out, but this often happens even when no orderByDecreasingArea and the code
+should cope.
+
+Maybe one of the filters does something strange in the degenerate case.
+
+See thread http://gis.19327.n8.nabble.com/Problem-with-r3706-tp5886790p5886799.html
+
+So: reduce the alignment shift by 1. (for highest resolution 24 goes negative, but Area ignores if <= 0)
+*/
+		int resolutionShift = orderByDecreasingArea ? (23 - resolution) : 0;
 		Area[] areas = bounds.split(nx, ny, resolutionShift);
 		if (areas == null) { //  Failed to split!
 			if (log.isDebugEnabled()) { // see what is here
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to