Skip to content

Commit 4ff8ab8

Browse files
authored
Fix our Jackson ShapeDeserializer for 3rd dimension (#224)
1 parent 2926812 commit 4ff8ab8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/locationtech/spatial4j/io/jackson/ShapeDeserializer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public Point readPoint(ArrayNode arr, ShapeFactory factory) {
4444
double x = arr.get(0).asDouble();
4545
double y = arr.get(1).asDouble();
4646
if(arr.size()==3) {
47-
double z = arr.get(3).asDouble();
47+
double z = arr.get(2).asDouble();
4848
return factory.pointXYZ(x, y, z);
4949
}
5050
return factory.pointXY(x, y);
@@ -57,7 +57,7 @@ private void fillPoints( ShapeFactory.PointsBuilder b, ArrayNode arrs ) {
5757
double x = arr.get(0).asDouble();
5858
double y = arr.get(1).asDouble();
5959
if(arr.size()==3) {
60-
double z = arr.get(3).asDouble();
60+
double z = arr.get(2).asDouble();
6161
b.pointXYZ(x, y, z);
6262
}
6363
else {
@@ -232,4 +232,4 @@ public Shape deserialize(JsonParser jp, DeserializationContext ctxt)
232232
}
233233
throw new JsonParseException(jp, "can't read GeoJSON yet");
234234
}
235-
}
235+
}

0 commit comments

Comments
 (0)