In JTS 1.13 WKBReader.readGeometry() stars with the following code:
private Geometry readGeometry()
throws IOException, ParseException
// determine byte order
byte byteOrder = dis.readByte();
// default is big endian
if (byteOrder == WKBConstants.wkbNDR)
when processing multiple geometries in a loop having mixed LITTLE- and BIG-ENDIAN, when geometry i has LITTLE_ENDIAN and i+1 has BIG_ENDIAN, in fact geometry (i+1) will be parsed as LITTLE_ENDIAN which will apparently fail.
The possible solution would be to add also if-check for WKBConstants.wkbXDR.
Log in to post a comment.