spatial4j icon indicating copy to clipboard operation
spatial4j copied to clipboard

NullPointerException in ShapeDeserializer when deserializing 3D coordinates

Open hauke96 opened this issue 3 years ago • 1 comments
trafficstars

When deserializing geometries with 3D coordinates using the jackson ShapeDeserializer I get a NullPointerException (s. stack trace below). This is probably due to lines 47 and 60 in https://github.com/locationtech/spatial4j/blob/master/src/main/java/org/locationtech/spatial4j/io/jackson/ShapeDeserializer.java where you access the 4th element (element at index 3) of an array of size 3.

java.lang.NullPointerException: null
	at org.locationtech.spatial4j.io.jackson.ShapeDeserializer.fillPoints(ShapeDeserializer.java:60)
	at org.locationtech.spatial4j.io.jackson.ShapeDeserializer.read(ShapeDeserializer.java:167)
	at org.locationtech.spatial4j.io.jackson.ShapeDeserializer.read(ShapeDeserializer.java:211)
	at org.locationtech.spatial4j.io.jackson.ShapeDeserializer.deserialize(ShapeDeserializer.java:220)
	at org.locationtech.spatial4j.io.jackson.GeometryDeserializer.deserialize(GeometryDeserializer.java:45)

hauke96 avatar Aug 15 '22 15:08 hauke96

Indeed. PR welcome :-)

dsmiley avatar Aug 15 '22 17:08 dsmiley

Merge request #224 is merged, so I'll take the liberty and close this.

hauke96 avatar Sep 01 '22 11:09 hauke96