logo separator

[mkgmap-dev] [PATCH v1] mkgmap crashes if nodes are missing

From WanMil wmgcnfg at web.de on Wed Jul 4 14:46:55 BST 2012

Hi Nop,

can you please test attatched patch?
Ways without any nodes should be handled by the multipolygon handling so 
I moved the fix in the multipolygon code.

How did you create such a file that contains ways without any nodes?

WanMil

> I have been debugging a crash of mkgamp where it fails with the exception
>
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>          at java.util.ArrayList.RangeCheck(Unknown Source)
>          at java.util.ArrayList.get(Unknown Source)
>          at
> uk.me.parabola.mkgmap.reader.osm.MultiPolygonRelation$JoinedWay.<init
>> (MultiPolygonRelation.java:2199)
>          at
> uk.me.parabola.mkgmap.reader.osm.MultiPolygonRelation.joinWays(MultiP
> olygonRelation.java:245)
>          at
> uk.me.parabola.mkgmap.reader.osm.MultiPolygonRelation.processElements
> (MultiPolygonRelation.java:763)
>          at
> uk.me.parabola.mkgmap.reader.osm.ElementSaver.addRelation(ElementSave
> r.java:166)
>          at
> uk.me.parabola.mkgmap.reader.osm.xml.Osm5XmlHandler$SaxHandler.endEle
> ment(Osm5XmlHandler.java:182)
>
> The reason seems to be inconsistent data: a way without the nodes it
> references. As mkgmap siletntly drops missing ways, but crashes on missing
> nodes I assume this is a bug.
>
> This can be fixed by changing Osm5XmlHandler, line 263 to
>
> 			if ("way".equals(type)){
> 				el = saver.getWay(id);
> 				// remove ways without points
> 				if( el != null && ((Way)el).getPoints().isEmpty() )
> 					el = null;
>                           }
>
> Maybe someone would like to apply this fix to make mkgmap more robust.
>
> bye
>                  Nop
>
>
> --
> View this message in context: http://gis.19327.n5.nabble.com/mkgmap-crashes-if-nodes-are-missing-tp5711811.html
> Sent from the Mkgmap Development mailing list archive at Nabble.com.
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: mp_emptyway_v1.patch
Type: text/x-patch
Size: 849 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20120704/1a5809d9/attachment.bin 


More information about the mkgmap-dev mailing list