wdtinc / mapbox-vector-tile-java

Java Mapbox Vector Tile Library for Encoding/Decoding
Apache License 2.0
147 stars 73 forks source link

Failure to parse when there is MULTILINESTRING #51

Open kevinlieb opened 3 years ago

kevinlieb commented 3 years ago

I am getting the following error: W/System.err: java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 W/System.err: at org.locationtech.jts.geom.impl.CoordinateArraySequence.setOrdinate(CoordinateArraySequence.java:299) W/System.err: at com.wdtinc.mapbox_vector_tile.adapt.jts.MvtReader.readPoints(MvtReader.java:227) W/System.err: at com.wdtinc.mapbox_vector_tile.adapt.jts.MvtReader.readGeometry(MvtReader.java:164) W/System.err: at com.wdtinc.mapbox_vector_tile.adapt.jts.MvtReader.loadMvt(MvtReader.java:141) W/System.err: at com.wdtinc.mapbox_vector_tile.adapt.jts.MvtReader.loadMvt(MvtReader.java:97) when I attempt to parse a tile with MULTILINESTRING I suspect the geometry in this case is an array of arrays and this is causing the failure.

I am using HERE for tile data.

The tile where this occurs is: https://vector.hereapi.com/v2/vectortiles/base/mc/16/10510/25420/omv?apiKey=xxyyzzzz

Is there a fix or workaround for this?

i23098 commented 2 years ago

Could it be that the data is wrong?

I put a debug before the error and it seems a bit weird for a POINT geom. Seems more a line or so. 9 is the command to move to then the coords, so lots of move to's... image