public class GeometryHullTool extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
GeometryHullTool.Edge |
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
LOGGER |
Constructor and Description |
---|
GeometryHullTool() |
Modifier and Type | Method and Description |
---|---|
static double |
calcAngle(org.locationtech.jts.geom.Coordinate one,
org.locationtech.jts.geom.Coordinate vertex,
org.locationtech.jts.geom.Coordinate two)
Calculate the angle between two points and a given vertex
|
static double |
calcDistance(org.locationtech.jts.geom.Coordinate start,
org.locationtech.jts.geom.Coordinate end,
org.locationtech.jts.geom.Coordinate point) |
static double[] |
calcDistanceSegment(org.locationtech.jts.geom.Coordinate start,
org.locationtech.jts.geom.Coordinate end,
org.locationtech.jts.geom.Coordinate point)
Calculate the distance between two points and a given vertex
|
static double |
calcSmallestAngle(org.locationtech.jts.geom.Coordinate one,
org.locationtech.jts.geom.Coordinate vertex,
org.locationtech.jts.geom.Coordinate two) |
static boolean |
clockwise(org.locationtech.jts.geom.Coordinate[] set)
Determine if the polygon is defined clockwise
|
org.locationtech.jts.geom.Geometry |
concaveHull(org.locationtech.jts.geom.Geometry geometry,
Collection<org.locationtech.jts.geom.Coordinate> providedInnerPoints)
Gift unwrapping (e.g.
|
org.locationtech.jts.geom.Geometry |
concaveHullParkOhMethod(org.locationtech.jts.geom.Geometry geometry,
Collection<org.locationtech.jts.geom.Coordinate> providedInnerPoints)
Gift unwrapping (e.g.
|
org.locationtech.jts.geom.Geometry |
connect(org.locationtech.jts.geom.Geometry shape1,
org.locationtech.jts.geom.Geometry shape2)
Forms create edges between two shapes maintaining convexity.
|
protected org.locationtech.jts.geom.Geometry |
connect(org.locationtech.jts.geom.Geometry shape1,
org.locationtech.jts.geom.Geometry shape2,
org.apache.commons.lang3.tuple.Pair<Integer,Integer> closestCoordinates) |
void |
connect(List<org.locationtech.jts.geom.Geometry> geometries) |
org.locationtech.jts.geom.Geometry |
createHullFromGeometry(org.locationtech.jts.geom.Geometry clusterGeometry,
Collection<org.locationtech.jts.geom.Coordinate> additionalPoints,
boolean fast) |
static boolean |
edgesIntersect(GeometryHullTool.Edge e1,
GeometryHullTool.Edge e2) |
static org.apache.commons.lang3.tuple.Pair<Integer,Integer> |
getClosestPoints(org.locationtech.jts.geom.Geometry shape1,
org.locationtech.jts.geom.Geometry shape2,
DistanceFn<org.locationtech.jts.geom.Coordinate> distanceFnForCoordinate) |
protected double |
getConcaveThreshold() |
DistanceFn<org.locationtech.jts.geom.Coordinate> |
getDistanceFnForCoordinate() |
static boolean |
intersectAnotherEdge(GeometryHullTool.Edge newEdge,
GeometryHullTool.Edge edgeToReplace) |
protected boolean |
isInside(org.locationtech.jts.geom.Coordinate coor,
org.locationtech.jts.geom.Coordinate[] hullCoordinates) |
protected void |
setConcaveThreshold(double concaveThreshold) |
void |
setDistanceFnForCoordinate(DistanceFn<org.locationtech.jts.geom.Coordinate> distanceFnForCoordinate) |
public void connect(List<org.locationtech.jts.geom.Geometry> geometries)
public DistanceFn<org.locationtech.jts.geom.Coordinate> getDistanceFnForCoordinate()
public void setDistanceFnForCoordinate(DistanceFn<org.locationtech.jts.geom.Coordinate> distanceFnForCoordinate)
protected double getConcaveThreshold()
protected void setConcaveThreshold(double concaveThreshold)
public org.locationtech.jts.geom.Geometry createHullFromGeometry(org.locationtech.jts.geom.Geometry clusterGeometry, Collection<org.locationtech.jts.geom.Coordinate> additionalPoints, boolean fast)
public org.locationtech.jts.geom.Geometry concaveHullParkOhMethod(org.locationtech.jts.geom.Geometry geometry, Collection<org.locationtech.jts.geom.Coordinate> providedInnerPoints)
Per the paper, N = concaveThreshold
public org.locationtech.jts.geom.Geometry concaveHull(org.locationtech.jts.geom.Geometry geometry, Collection<org.locationtech.jts.geom.Coordinate> providedInnerPoints)
Per the paper, N = concaveThreshold.
This algorithm evaluates remarkably faster than Park and Oh, but the quality of the result is marginally less. If it is acceptable to have some small number of points fall outside of the hull and speed is critical, use this method. The measure of error is difficult to calculate since it is not directly calculated based on the number of inner points. Rather, the measure is based on some number of points in proximity the optimal concave hull.
public static boolean intersectAnotherEdge(GeometryHullTool.Edge newEdge, GeometryHullTool.Edge edgeToReplace)
public static boolean edgesIntersect(GeometryHullTool.Edge e1, GeometryHullTool.Edge e2)
protected boolean isInside(org.locationtech.jts.geom.Coordinate coor, org.locationtech.jts.geom.Coordinate[] hullCoordinates)
public org.locationtech.jts.geom.Geometry connect(org.locationtech.jts.geom.Geometry shape1, org.locationtech.jts.geom.Geometry shape2)
Does not currently work if the shapes intersect
protected org.locationtech.jts.geom.Geometry connect(org.locationtech.jts.geom.Geometry shape1, org.locationtech.jts.geom.Geometry shape2, org.apache.commons.lang3.tuple.Pair<Integer,Integer> closestCoordinates)
public static boolean clockwise(org.locationtech.jts.geom.Coordinate[] set)
public static double calcSmallestAngle(org.locationtech.jts.geom.Coordinate one, org.locationtech.jts.geom.Coordinate vertex, org.locationtech.jts.geom.Coordinate two)
public static double calcAngle(org.locationtech.jts.geom.Coordinate one, org.locationtech.jts.geom.Coordinate vertex, org.locationtech.jts.geom.Coordinate two)
public static double[] calcDistanceSegment(org.locationtech.jts.geom.Coordinate start, org.locationtech.jts.geom.Coordinate end, org.locationtech.jts.geom.Coordinate point)
public static double calcDistance(org.locationtech.jts.geom.Coordinate start, org.locationtech.jts.geom.Coordinate end, org.locationtech.jts.geom.Coordinate point)
public static org.apache.commons.lang3.tuple.Pair<Integer,Integer> getClosestPoints(org.locationtech.jts.geom.Geometry shape1, org.locationtech.jts.geom.Geometry shape2, DistanceFn<org.locationtech.jts.geom.Coordinate> distanceFnForCoordinate)
Copyright © 2013–2022. All rights reserved.