locationtech / jts

The JTS Topology Suite is a Java library for creating and manipulating vector geometry.
Other
1.9k stars 437 forks source link

concaveHullByLengthRatio throws a NullPointerException #1061

Open neil-cse opened 3 weeks ago

neil-cse commented 3 weeks ago

Given the following multi-point:

MULTIPOINT ((500793.45 158815.25), (500793.95 158815.55), (500793.2 158816.65), (500710.65 158761.2), (500711.3 158760.1), (500750.1 158786.35), (500771.7 158800.9), (500787.05 158811.05))

JTS version 1.19.0

This happens with seemingly any lengthRatio, or at least 0.0, 1.0 and several values in between.

stack trace:

org.locationtech.jts.algorithm.hull.HullTriangulation/nextBorderTri (HullTriangulation.java:165)
org.locationtech.jts.algorithm.hull.HullTriangulation/traceBoundary (HullTriangulation.java:142)
org.locationtech.jts.algorithm.hull.HullTriangulation/traceBoundaryPolygon (HullTriangulation.java:113)
org.locationtech.jts.algorithm.hull.ConcaveHull/toGeometry (ConcaveHull.java:438)
org.locationtech.jts.algorithm.hull.ConcaveHull/getHull (ConcaveHull.java:236)
org.locationtech.jts.algorithm.hull.ConcaveHull/concaveHullByLengthRatio (ConcaveHull.java:145)

Thanks!

dr-jts commented 3 weeks ago

This works in the latest codebase. Probably fixed by #931.