凸包算法实现
Geometry hull = (new ConvexHull(geom)).getConvexHull();
获得结果
public static Polygon get(Geometry geom, GeometryFactory gf) {
Geometry hull = (new ConvexHull(geom)).getConvexHull();
if (!(hull instanceof Polygon)) {
return null;
}
Polygon convexHull = (Polygon) hull;
System.out.println(convexHull);
// 直接使用中心值
Coordinate c = geom.getCentroid().getCoordinate();
System.out.println("==============旋转基点==============");
System.out.println(new GeometryFactory().createPoint(c));
System.out.println("==============旋转基点==============");
Coordinate[] coords &