Class Functions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.locationtech.jts.geom.GeometryaddMeasure(org.locationtech.jts.geom.Geometry geom, double measure_start, double measure_end) static org.locationtech.jts.geom.GeometryaddPoint(org.locationtech.jts.geom.Geometry linestring, org.locationtech.jts.geom.Geometry point) static org.locationtech.jts.geom.GeometryaddPoint(org.locationtech.jts.geom.Geometry linestring, org.locationtech.jts.geom.Geometry point, int position) static org.locationtech.jts.geom.Geometryaffine(org.locationtech.jts.geom.Geometry geometry, double a, double b, double d, double e, double xOff, double yOff) static org.locationtech.jts.geom.Geometryaffine(org.locationtech.jts.geom.Geometry geometry, double a, double b, double c, double d, double e, double f, double g, double h, double i, double xOff, double yOff, double zOff) static doubleangle(org.locationtech.jts.geom.Geometry line1, org.locationtech.jts.geom.Geometry line2) static doubleangle(org.locationtech.jts.geom.Geometry point1, org.locationtech.jts.geom.Geometry point2, org.locationtech.jts.geom.Geometry point3) static doubleangle(org.locationtech.jts.geom.Geometry point1, org.locationtech.jts.geom.Geometry point2, org.locationtech.jts.geom.Geometry point3, org.locationtech.jts.geom.Geometry point4) static org.locationtech.jts.geom.GeometryapproximateMedialAxis(org.locationtech.jts.geom.Geometry geometry) Computes an approximate medial axis of an areal geometry by computing the straight skeleton and filtering to keep only interior edges.static org.locationtech.jts.geom.GeometryapproximateMedialAxis(org.locationtech.jts.geom.Geometry geometry, Integer maxVertices) Computes an approximate medial axis of an areal geometry by computing the straight skeleton and filtering to keep only interior edges, with optional vertex simplification.static doublearea(org.locationtech.jts.geom.Geometry geometry) static byte[]static byte[]asEWKB(org.locationtech.jts.geom.Geometry geometry) static Stringstatic StringasEWKT(org.locationtech.jts.geom.Geometry geometry) static StringasGeoJson(org.locationtech.jts.geom.Geometry geometry) static Stringstatic StringasGML(org.locationtech.jts.geom.Geometry geometry) static StringasHexEWKB(org.locationtech.jts.geom.Geometry geom) static Stringstatic StringasKML(org.locationtech.jts.geom.Geometry geometry) static byte[]asWKB(org.locationtech.jts.geom.Geometry geometry) static StringasWKT(org.locationtech.jts.geom.Geometry geometry) static doubleazimuth(org.locationtech.jts.geom.Geometry left, org.locationtech.jts.geom.Geometry right) static doublebaseLength(org.locationtech.jts.geom.Geometry geometry) static intbestSRID(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.Geometryboundary(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometryboundingDiagonal(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.Geometrybuffer(org.locationtech.jts.geom.Geometry geometry, double radius) static org.locationtech.jts.geom.Geometrybuffer(org.locationtech.jts.geom.Geometry geometry, double radius, boolean useSpheroid) static org.locationtech.jts.geom.Geometrybuffer(org.locationtech.jts.geom.Geometry geometry, double radius, boolean useSpheroid, String params) static org.locationtech.jts.geom.GeometrybuildArea(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometryclosestPoint(org.locationtech.jts.geom.Geometry left, org.locationtech.jts.geom.Geometry right) static org.locationtech.jts.geom.GeometrycollectionExtract(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometrycollectionExtract(org.locationtech.jts.geom.Geometry geometry, Integer geomType) static org.locationtech.jts.geom.GeometryconcaveHull(org.locationtech.jts.geom.Geometry geometry, double pctConvex, boolean allowHoles) static org.locationtech.jts.geom.GeometryconvexHull(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometrycreateMultiGeometry(org.locationtech.jts.geom.Geometry[] geometries) static org.locationtech.jts.geom.GeometrycreateMultiGeometryFromOneElement(org.locationtech.jts.geom.Geometry geometry) static booleancrossesDateLine(org.locationtech.jts.geom.Geometry geometry) Checks if a geometry crosses the International Date Line.static doubledegrees(double angleInRadian) static org.locationtech.jts.geom.GeometrydelaunayTriangle(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometrydelaunayTriangle(org.locationtech.jts.geom.Geometry geometry, double tolerance) static org.locationtech.jts.geom.GeometrydelaunayTriangle(org.locationtech.jts.geom.Geometry geometry, double tolerance, int flag) static org.locationtech.jts.geom.Geometrydifference(org.locationtech.jts.geom.Geometry leftGeometry, org.locationtech.jts.geom.Geometry rightGeometry) static Integerdimension(org.locationtech.jts.geom.Geometry geometry) static Doubledistance(org.locationtech.jts.geom.Geometry left, org.locationtech.jts.geom.Geometry right) static doubledistance3d(org.locationtech.jts.geom.Geometry left, org.locationtech.jts.geom.Geometry right) static org.locationtech.jts.geom.Geometry[]dump(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.Geometry[]dumpPoints(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometryendPoint(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.Geometryenvelope(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.Geometryexpand(org.locationtech.jts.geom.Geometry geometry, double uniformDelta) static org.locationtech.jts.geom.Geometryexpand(org.locationtech.jts.geom.Geometry geometry, double deltaX, double deltaY) static org.locationtech.jts.geom.Geometryexpand(org.locationtech.jts.geom.Geometry geometry, double deltaX, double deltaY, double deltaZ) static org.locationtech.jts.geom.GeometryexteriorRing(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometryflipCoordinates(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.Geometryforce2D(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.Geometryforce3D(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.Geometryforce3D(org.locationtech.jts.geom.Geometry geometry, double zValue) static org.locationtech.jts.geom.Geometryforce3DM(org.locationtech.jts.geom.Geometry geom) static org.locationtech.jts.geom.Geometryforce3DM(org.locationtech.jts.geom.Geometry geom, double mValue) static org.locationtech.jts.geom.Geometryforce4D(org.locationtech.jts.geom.Geometry geom) static org.locationtech.jts.geom.Geometryforce4D(org.locationtech.jts.geom.Geometry geom, double zValue, double mValue) static org.locationtech.jts.geom.GeometryforceCollection(org.locationtech.jts.geom.Geometry geom) static org.locationtech.jts.geom.GeometryforcePolygonCCW(org.locationtech.jts.geom.Geometry geom) Forces a Polygon/MultiPolygon to use counter-clockwise orientation for the exterior ring and a clockwise for the interior ring(s).static org.locationtech.jts.geom.GeometryforcePolygonCW(org.locationtech.jts.geom.Geometry geom) Forces a Polygon/MultiPolygon to use clockwise orientation for the exterior ring and a counter-clockwise for the interior ring(s).static doublefrechetDistance(org.locationtech.jts.geom.Geometry g1, org.locationtech.jts.geom.Geometry g2) static org.locationtech.jts.geom.GeometrygeneratePoints(org.locationtech.jts.geom.Geometry geom, int numPoints) static org.locationtech.jts.geom.GeometrygeneratePoints(org.locationtech.jts.geom.Geometry geom, int numPoints, long seed) static org.locationtech.jts.geom.GeometrygeneratePoints(org.locationtech.jts.geom.Geometry geom, int numPoints, Random random) static Stringgeohash(org.locationtech.jts.geom.Geometry geometry, int precision) static org.locationtech.jts.geom.GeometrygeometricMedian(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometrygeometricMedian(org.locationtech.jts.geom.Geometry geometry, double tolerance) static org.locationtech.jts.geom.GeometrygeometricMedian(org.locationtech.jts.geom.Geometry geometry, double tolerance, int maxIter) static org.locationtech.jts.geom.GeometrygeometricMedian(org.locationtech.jts.geom.Geometry geometry, double tolerance, int maxIter, boolean failIfNotConverged) static org.locationtech.jts.geom.GeometrygeometryN(org.locationtech.jts.geom.Geometry geometry, int n) static StringgeometryType(org.locationtech.jts.geom.Geometry geometry) static StringgeometryTypeWithMeasured(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometrygetCentroid(org.locationtech.jts.geom.Geometry geometry) static intgetSRID(org.locationtech.jts.geom.Geometry geometry) static longh3CellDistance(long cell1, long cell2) return the distance between 2 cells, if the native h3 function doesn't work, use our approximation function for shortest path and use the size - 1 as distancestatic Long[]h3CellIDs(org.locationtech.jts.geom.Geometry input, int level, boolean fullCover) cover the geometry with H3 cellsstatic Long[]h3KRing(long cell, int k, boolean exactDistance) get the neighbor cells of the input cell by h3.gridDisk functionstatic org.locationtech.jts.geom.Geometry[]h3ToGeom(long[] cells) gets the polygon for each h3 index providedstatic booleanhasM(org.locationtech.jts.geom.Geometry geom) static booleanhasZ(org.locationtech.jts.geom.Geometry geom) static DoublehausdorffDistance(org.locationtech.jts.geom.Geometry g1, org.locationtech.jts.geom.Geometry g2) static DoublehausdorffDistance(org.locationtech.jts.geom.Geometry g1, org.locationtech.jts.geom.Geometry g2, double densityFrac) static org.locationtech.jts.geom.GeometryinteriorRingN(org.locationtech.jts.geom.Geometry geometry, int n) static doubleinterpolatePoint(org.locationtech.jts.geom.Geometry geom1, org.locationtech.jts.geom.Geometry geom2) This function returns the m coordinate of the closest point in a LineString to the specified Point.static org.locationtech.jts.geom.Geometryintersection(org.locationtech.jts.geom.Geometry leftGeometry, org.locationtech.jts.geom.Geometry rightGeometry) static booleanisClosed(org.locationtech.jts.geom.Geometry geometry) static booleanisCollection(org.locationtech.jts.geom.Geometry geometry) static booleanisEmpty(org.locationtech.jts.geom.Geometry geometry) static booleanisPolygonCCW(org.locationtech.jts.geom.Geometry geom) This function accepts Polygon and MultiPolygon, if any other type is provided then it will return false.static booleanisPolygonCW(org.locationtech.jts.geom.Geometry geom) This function accepts Polygon and MultiPolygon, if any other type is provided then it will return false.static booleanisRing(org.locationtech.jts.geom.Geometry geometry) static booleanisSimple(org.locationtech.jts.geom.Geometry geometry) static booleanisValid(org.locationtech.jts.geom.Geometry geometry) static booleanisValid(org.locationtech.jts.geom.Geometry geom, int flag) static ValidDetailisValidDetail(org.locationtech.jts.geom.Geometry geom) static ValidDetailisValidDetail(org.locationtech.jts.geom.Geometry geom, int flag) static StringisValidReason(org.locationtech.jts.geom.Geometry geom) static StringisValidReason(org.locationtech.jts.geom.Geometry geom, int flag) static booleanisValidTrajectory(org.locationtech.jts.geom.Geometry geom) static org.locationtech.jts.geom.GeometrylabelPoint(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometrylabelPoint(org.locationtech.jts.geom.Geometry geometry, int gridResolution) static org.locationtech.jts.geom.GeometrylabelPoint(org.locationtech.jts.geom.Geometry geometry, int gridResolution, double goodnessThreshold) static doublelength(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometrylineFromMultiPoint(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometrylineInterpolatePoint(org.locationtech.jts.geom.Geometry geom, double fraction) static doublelineLocatePoint(org.locationtech.jts.geom.Geometry geom, org.locationtech.jts.geom.Geometry point) static org.locationtech.jts.geom.GeometrylineMerge(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.Geometry[]lineSegments(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.Geometry[]lineSegments(org.locationtech.jts.geom.Geometry geometry, boolean lenient) static org.locationtech.jts.geom.GeometrylineSubString(org.locationtech.jts.geom.Geometry geom, double fromFraction, double toFraction) static org.locationtech.jts.geom.GeometrylocateAlong(org.locationtech.jts.geom.Geometry linear, double measure) static org.locationtech.jts.geom.GeometrylocateAlong(org.locationtech.jts.geom.Geometry linear, double measure, double offset) static org.locationtech.jts.geom.GeometrylongestLine(org.locationtech.jts.geom.Geometry geom1, org.locationtech.jts.geom.Geometry geom2) static Doublem(org.locationtech.jts.geom.Geometry geom) static org.locationtech.jts.geom.GeometrymakeLine(org.locationtech.jts.geom.Geometry[] geoms) static org.locationtech.jts.geom.GeometrymakeLine(org.locationtech.jts.geom.Geometry geom1, org.locationtech.jts.geom.Geometry geom2) static org.locationtech.jts.geom.GeometrymakePolygon(org.locationtech.jts.geom.Geometry shell, org.locationtech.jts.geom.Geometry[] holes) static org.locationtech.jts.geom.GeometrymakePolygon(org.locationtech.jts.geom.Geometry shell, org.locationtech.jts.geom.Geometry[] holes, org.locationtech.jts.geom.GeometryFactory factory) static org.locationtech.jts.geom.GeometrymakepolygonWithSRID(org.locationtech.jts.geom.Geometry lineString, Integer srid) static org.locationtech.jts.geom.GeometrymakeValid(org.locationtech.jts.geom.Geometry geometry, boolean keepCollapsed) static doublemaxDistance(org.locationtech.jts.geom.Geometry geom1, org.locationtech.jts.geom.Geometry geom2) static InscribedCirclemaximumInscribedCircle(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometryminimumBoundingCircle(org.locationtech.jts.geom.Geometry geometry, int quadrantSegments) static org.apache.commons.lang3.tuple.Pair<org.locationtech.jts.geom.Geometry,Double> minimumBoundingRadius(org.locationtech.jts.geom.Geometry geometry) static doubleminimumClearance(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometryminimumClearanceLine(org.locationtech.jts.geom.Geometry geometry) static DoublemMax(org.locationtech.jts.geom.Geometry geometry) static DoublemMin(org.locationtech.jts.geom.Geometry geometry) static intnDims(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.Geometrynormalize(org.locationtech.jts.geom.Geometry geometry) static voidnormalizeLongitude(org.locationtech.jts.geom.Geometry geometry) Corrects the longitudes of a geometry to be within the -180 to 180 range.static intnPoints(org.locationtech.jts.geom.Geometry geometry) static IntegernRings(org.locationtech.jts.geom.Geometry geometry) static intnumGeometries(org.locationtech.jts.geom.Geometry geometry) static IntegernumInteriorRings(org.locationtech.jts.geom.Geometry geometry) static intnumPoints(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometryorientedEnvelope(org.locationtech.jts.geom.Geometry geometry) static doubleperimeter(org.locationtech.jts.geom.Geometry geometry) static doubleperimeter(org.locationtech.jts.geom.Geometry geometry, boolean use_spheroid) static doubleperimeter(org.locationtech.jts.geom.Geometry geometry, boolean use_spheroid, boolean lenient) static org.locationtech.jts.geom.GeometrypointN(org.locationtech.jts.geom.Geometry geometry, int n) static org.locationtech.jts.geom.GeometrypointOnSurface(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.Geometrypoints(org.locationtech.jts.geom.Geometry geometry) Creates a MultiPoint containing all coordinates of the given geometry.static org.locationtech.jts.geom.Geometrypolygonize(org.locationtech.jts.geom.Geometry geometry) This method takes a GeometryCollection and returns another GeometryCollection containing the polygons formed by the linework of a set of geometries.static org.locationtech.jts.geom.Geometryproject(org.locationtech.jts.geom.Geometry point, double distance, double azimuth) static org.locationtech.jts.geom.Geometryproject(org.locationtech.jts.geom.Geometry point, double distance, double azimuth, boolean lenient) static org.locationtech.jts.geom.GeometryreducePrecision(org.locationtech.jts.geom.Geometry geometry, int precisionScale) static org.locationtech.jts.geom.GeometryremovePoint(org.locationtech.jts.geom.Geometry linestring) static org.locationtech.jts.geom.GeometryremovePoint(org.locationtech.jts.geom.Geometry linestring, int position) static org.locationtech.jts.geom.GeometryremoveRepeatedPoints(org.locationtech.jts.geom.Geometry geom) static org.locationtech.jts.geom.GeometryremoveRepeatedPoints(org.locationtech.jts.geom.Geometry geom, double tolerance) static org.locationtech.jts.geom.Geometryreverse(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.Geometryrotate(org.locationtech.jts.geom.Geometry geometry, double angle) Rotates a geometry by a given angle in radians.static org.locationtech.jts.geom.Geometryrotate(org.locationtech.jts.geom.Geometry geometry, double angle, double originX, double originY) Rotates a geometry by a given angle in radians around a given origin point (x, y).static org.locationtech.jts.geom.Geometryrotate(org.locationtech.jts.geom.Geometry geometry, double angle, org.locationtech.jts.geom.Geometry pointOrigin) Rotates a geometry by a given angle in radians around a given origin point.static org.locationtech.jts.geom.GeometryrotateX(org.locationtech.jts.geom.Geometry geometry, double angle) static org.locationtech.jts.geom.GeometryrotateY(org.locationtech.jts.geom.Geometry geometry, double angle) static Long[]s2CellIDs(org.locationtech.jts.geom.Geometry input, int level) get the coordinates of a geometry and transform to Google s2 cell idstatic org.locationtech.jts.geom.Geometry[]s2ToGeom(long[] cellIds) static org.locationtech.jts.geom.Geometryscale(org.locationtech.jts.geom.Geometry geometry, double scaleX, double scaleY) static org.locationtech.jts.geom.GeometryscaleGeom(org.locationtech.jts.geom.Geometry geometry, org.locationtech.jts.geom.Geometry factor) static org.locationtech.jts.geom.GeometryscaleGeom(org.locationtech.jts.geom.Geometry geometry, org.locationtech.jts.geom.Geometry factor, org.locationtech.jts.geom.Geometry origin) static org.locationtech.jts.geom.Geometrysegmentize(org.locationtech.jts.geom.Geometry geometry, double maxSegmentLength) static org.locationtech.jts.geom.GeometrysetPoint(org.locationtech.jts.geom.Geometry linestring, int position, org.locationtech.jts.geom.Geometry point) static org.locationtech.jts.geom.GeometrysetSRID(org.locationtech.jts.geom.Geometry geometry, int srid) static org.locationtech.jts.geom.GeometryshiftLongitude(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.Geometrysimplify(org.locationtech.jts.geom.Geometry geom, double distanceTolerance) static org.locationtech.jts.geom.GeometrysimplifyPolygonHull(org.locationtech.jts.geom.Geometry geometry, double vertexFactor) static org.locationtech.jts.geom.GeometrysimplifyPolygonHull(org.locationtech.jts.geom.Geometry geometry, double vertexFactor, boolean isOuter) static org.locationtech.jts.geom.GeometrysimplifyPreserveTopology(org.locationtech.jts.geom.Geometry geometry, double distanceTolerance) static org.locationtech.jts.geom.GeometrysimplifyVW(org.locationtech.jts.geom.Geometry geometry, double tolerance) static org.locationtech.jts.geom.Geometrysnap(org.locationtech.jts.geom.Geometry input, org.locationtech.jts.geom.Geometry reference, double tolerance) static org.locationtech.jts.geom.Geometrysplit(org.locationtech.jts.geom.Geometry input, org.locationtech.jts.geom.Geometry blade) static org.locationtech.jts.geom.GeometrystartPoint(org.locationtech.jts.geom.Geometry geometry) static org.locationtech.jts.geom.GeometrystraightSkeleton(org.locationtech.jts.geom.Geometry geometry) Computes the straight skeleton of an areal geometry.static org.locationtech.jts.geom.GeometrystraightSkeleton(org.locationtech.jts.geom.Geometry geometry, Integer maxVertices) Computes the straight skeleton of an areal geometry with optional vertex simplification.static org.locationtech.jts.geom.Geometry[]subDivide(org.locationtech.jts.geom.Geometry geometry, int maxVertices) static org.locationtech.jts.geom.GeometrysymDifference(org.locationtech.jts.geom.Geometry leftGeom, org.locationtech.jts.geom.Geometry rightGeom) static org.locationtech.jts.geom.Geometrytranslate(org.locationtech.jts.geom.Geometry geometry, double deltaX, double deltaY) static org.locationtech.jts.geom.Geometrytranslate(org.locationtech.jts.geom.Geometry geometry, double deltaX, double deltaY, double deltaZ) static org.locationtech.jts.geom.GeometrytriangulatePolygon(org.locationtech.jts.geom.Geometry geom) static org.locationtech.jts.geom.GeometryunaryUnion(org.locationtech.jts.geom.Geometry geom) static org.locationtech.jts.geom.Geometryunion(org.locationtech.jts.geom.Geometry[] geoms) static org.locationtech.jts.geom.Geometryunion(org.locationtech.jts.geom.Geometry leftGeom, org.locationtech.jts.geom.Geometry rightGeom) static Doublex(org.locationtech.jts.geom.Geometry geometry) static doublexMax(org.locationtech.jts.geom.Geometry geometry) static doublexMin(org.locationtech.jts.geom.Geometry geometry) static Doubley(org.locationtech.jts.geom.Geometry geometry) static doubleyMax(org.locationtech.jts.geom.Geometry geometry) static doubleyMin(org.locationtech.jts.geom.Geometry geometry) static Doublez(org.locationtech.jts.geom.Geometry geometry) static DoublezMax(org.locationtech.jts.geom.Geometry geometry) static intzmFlag(org.locationtech.jts.geom.Geometry geom) static DoublezMin(org.locationtech.jts.geom.Geometry geometry)
-
Constructor Details
-
Functions
public Functions()
-
-
Method Details
-
area
public static double area(org.locationtech.jts.geom.Geometry geometry) -
labelPoint
public static org.locationtech.jts.geom.Geometry labelPoint(org.locationtech.jts.geom.Geometry geometry) -
labelPoint
public static org.locationtech.jts.geom.Geometry labelPoint(org.locationtech.jts.geom.Geometry geometry, int gridResolution) -
labelPoint
public static org.locationtech.jts.geom.Geometry labelPoint(org.locationtech.jts.geom.Geometry geometry, int gridResolution, double goodnessThreshold) -
azimuth
public static double azimuth(org.locationtech.jts.geom.Geometry left, org.locationtech.jts.geom.Geometry right) -
boundary
public static org.locationtech.jts.geom.Geometry boundary(org.locationtech.jts.geom.Geometry geometry) -
expand
public static org.locationtech.jts.geom.Geometry expand(org.locationtech.jts.geom.Geometry geometry, double uniformDelta) -
expand
public static org.locationtech.jts.geom.Geometry expand(org.locationtech.jts.geom.Geometry geometry, double deltaX, double deltaY) -
expand
public static org.locationtech.jts.geom.Geometry expand(org.locationtech.jts.geom.Geometry geometry, double deltaX, double deltaY, double deltaZ) -
buffer
public static org.locationtech.jts.geom.Geometry buffer(org.locationtech.jts.geom.Geometry geometry, double radius) -
buffer
public static org.locationtech.jts.geom.Geometry buffer(org.locationtech.jts.geom.Geometry geometry, double radius, boolean useSpheroid) -
buffer
public static org.locationtech.jts.geom.Geometry buffer(org.locationtech.jts.geom.Geometry geometry, double radius, boolean useSpheroid, String params) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
bestSRID
public static int bestSRID(org.locationtech.jts.geom.Geometry geometry) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
normalizeLongitude
public static void normalizeLongitude(org.locationtech.jts.geom.Geometry geometry) Corrects the longitudes of a geometry to be within the -180 to 180 range. This method modifies the original geometry.- Parameters:
geometry- The geometry to be corrected.
-
crossesDateLine
public static boolean crossesDateLine(org.locationtech.jts.geom.Geometry geometry) Checks if a geometry crosses the International Date Line.- Parameters:
geometry- The geometry to check.- Returns:
- True if the geometry crosses the Date Line, false otherwise.
-
shiftLongitude
public static org.locationtech.jts.geom.Geometry shiftLongitude(org.locationtech.jts.geom.Geometry geometry) -
envelope
public static org.locationtech.jts.geom.Geometry envelope(org.locationtech.jts.geom.Geometry geometry) -
distance
public static Double distance(org.locationtech.jts.geom.Geometry left, org.locationtech.jts.geom.Geometry right) -
distance3d
public static double distance3d(org.locationtech.jts.geom.Geometry left, org.locationtech.jts.geom.Geometry right) -
baseLength
public static double baseLength(org.locationtech.jts.geom.Geometry geometry) -
length
public static double length(org.locationtech.jts.geom.Geometry geometry) -
normalize
public static org.locationtech.jts.geom.Geometry normalize(org.locationtech.jts.geom.Geometry geometry) -
x
-
y
-
z
-
m
-
mMin
-
mMax
-
xMin
public static double xMin(org.locationtech.jts.geom.Geometry geometry) -
xMax
public static double xMax(org.locationtech.jts.geom.Geometry geometry) -
yMin
public static double yMin(org.locationtech.jts.geom.Geometry geometry) -
yMax
public static double yMax(org.locationtech.jts.geom.Geometry geometry) -
zMax
-
zMin
-
hasM
public static boolean hasM(org.locationtech.jts.geom.Geometry geom) -
hasZ
public static boolean hasZ(org.locationtech.jts.geom.Geometry geom) -
flipCoordinates
public static org.locationtech.jts.geom.Geometry flipCoordinates(org.locationtech.jts.geom.Geometry geometry) -
geohash
-
pointOnSurface
public static org.locationtech.jts.geom.Geometry pointOnSurface(org.locationtech.jts.geom.Geometry geometry) -
reverse
public static org.locationtech.jts.geom.Geometry reverse(org.locationtech.jts.geom.Geometry geometry) -
geometryN
public static org.locationtech.jts.geom.Geometry geometryN(org.locationtech.jts.geom.Geometry geometry, int n) -
interiorRingN
public static org.locationtech.jts.geom.Geometry interiorRingN(org.locationtech.jts.geom.Geometry geometry, int n) -
pointN
public static org.locationtech.jts.geom.Geometry pointN(org.locationtech.jts.geom.Geometry geometry, int n) -
exteriorRing
public static org.locationtech.jts.geom.Geometry exteriorRing(org.locationtech.jts.geom.Geometry geometry) -
asEWKT
-
asEWKT
-
asWKT
-
asEWKB
public static byte[] asEWKB(org.locationtech.jts.geom.Geometry geometry) -
asEWKB
-
asHexEWKB
-
asHexEWKB
-
asWKB
public static byte[] asWKB(org.locationtech.jts.geom.Geometry geometry) -
asGeoJson
-
asGeoJson
-
nPoints
public static int nPoints(org.locationtech.jts.geom.Geometry geometry) -
nDims
public static int nDims(org.locationtech.jts.geom.Geometry geometry) -
numGeometries
public static int numGeometries(org.locationtech.jts.geom.Geometry geometry) -
numInteriorRings
-
asGML
-
asKML
-
force2D
public static org.locationtech.jts.geom.Geometry force2D(org.locationtech.jts.geom.Geometry geometry) -
isEmpty
public static boolean isEmpty(org.locationtech.jts.geom.Geometry geometry) -
buildArea
public static org.locationtech.jts.geom.Geometry buildArea(org.locationtech.jts.geom.Geometry geometry) -
setSRID
public static org.locationtech.jts.geom.Geometry setSRID(org.locationtech.jts.geom.Geometry geometry, int srid) -
getSRID
public static int getSRID(org.locationtech.jts.geom.Geometry geometry) -
isClosed
public static boolean isClosed(org.locationtech.jts.geom.Geometry geometry) -
isRing
public static boolean isRing(org.locationtech.jts.geom.Geometry geometry) -
isSimple
public static boolean isSimple(org.locationtech.jts.geom.Geometry geometry) -
isValid
public static boolean isValid(org.locationtech.jts.geom.Geometry geometry) -
isValid
public static boolean isValid(org.locationtech.jts.geom.Geometry geom, int flag) -
isValidTrajectory
public static boolean isValidTrajectory(org.locationtech.jts.geom.Geometry geom) -
addPoint
public static org.locationtech.jts.geom.Geometry addPoint(org.locationtech.jts.geom.Geometry linestring, org.locationtech.jts.geom.Geometry point) -
addPoint
public static org.locationtech.jts.geom.Geometry addPoint(org.locationtech.jts.geom.Geometry linestring, org.locationtech.jts.geom.Geometry point, int position) -
removePoint
public static org.locationtech.jts.geom.Geometry removePoint(org.locationtech.jts.geom.Geometry linestring) -
removePoint
public static org.locationtech.jts.geom.Geometry removePoint(org.locationtech.jts.geom.Geometry linestring, int position) -
removeRepeatedPoints
public static org.locationtech.jts.geom.Geometry removeRepeatedPoints(org.locationtech.jts.geom.Geometry geom, double tolerance) -
removeRepeatedPoints
public static org.locationtech.jts.geom.Geometry removeRepeatedPoints(org.locationtech.jts.geom.Geometry geom) -
setPoint
public static org.locationtech.jts.geom.Geometry setPoint(org.locationtech.jts.geom.Geometry linestring, int position, org.locationtech.jts.geom.Geometry point) -
lineFromMultiPoint
public static org.locationtech.jts.geom.Geometry lineFromMultiPoint(org.locationtech.jts.geom.Geometry geometry) -
closestPoint
public static org.locationtech.jts.geom.Geometry closestPoint(org.locationtech.jts.geom.Geometry left, org.locationtech.jts.geom.Geometry right) -
delaunayTriangle
public static org.locationtech.jts.geom.Geometry delaunayTriangle(org.locationtech.jts.geom.Geometry geometry) -
delaunayTriangle
public static org.locationtech.jts.geom.Geometry delaunayTriangle(org.locationtech.jts.geom.Geometry geometry, double tolerance) -
delaunayTriangle
public static org.locationtech.jts.geom.Geometry delaunayTriangle(org.locationtech.jts.geom.Geometry geometry, double tolerance, int flag) -
zmFlag
public static int zmFlag(org.locationtech.jts.geom.Geometry geom) -
concaveHull
public static org.locationtech.jts.geom.Geometry concaveHull(org.locationtech.jts.geom.Geometry geometry, double pctConvex, boolean allowHoles) -
convexHull
public static org.locationtech.jts.geom.Geometry convexHull(org.locationtech.jts.geom.Geometry geometry) -
getCentroid
public static org.locationtech.jts.geom.Geometry getCentroid(org.locationtech.jts.geom.Geometry geometry) -
intersection
public static org.locationtech.jts.geom.Geometry intersection(org.locationtech.jts.geom.Geometry leftGeometry, org.locationtech.jts.geom.Geometry rightGeometry) -
makeValid
public static org.locationtech.jts.geom.Geometry makeValid(org.locationtech.jts.geom.Geometry geometry, boolean keepCollapsed) -
reducePrecision
public static org.locationtech.jts.geom.Geometry reducePrecision(org.locationtech.jts.geom.Geometry geometry, int precisionScale) -
lineMerge
public static org.locationtech.jts.geom.Geometry lineMerge(org.locationtech.jts.geom.Geometry geometry) -
lineSegments
public static org.locationtech.jts.geom.Geometry[] lineSegments(org.locationtech.jts.geom.Geometry geometry, boolean lenient) -
lineSegments
public static org.locationtech.jts.geom.Geometry[] lineSegments(org.locationtech.jts.geom.Geometry geometry) -
minimumBoundingCircle
public static org.locationtech.jts.geom.Geometry minimumBoundingCircle(org.locationtech.jts.geom.Geometry geometry, int quadrantSegments) -
orientedEnvelope
public static org.locationtech.jts.geom.Geometry orientedEnvelope(org.locationtech.jts.geom.Geometry geometry) -
maximumInscribedCircle
-
minimumBoundingRadius
public static org.apache.commons.lang3.tuple.Pair<org.locationtech.jts.geom.Geometry,Double> minimumBoundingRadius(org.locationtech.jts.geom.Geometry geometry) -
minimumClearance
public static double minimumClearance(org.locationtech.jts.geom.Geometry geometry) -
minimumClearanceLine
public static org.locationtech.jts.geom.Geometry minimumClearanceLine(org.locationtech.jts.geom.Geometry geometry) -
lineSubString
public static org.locationtech.jts.geom.Geometry lineSubString(org.locationtech.jts.geom.Geometry geom, double fromFraction, double toFraction) -
lineInterpolatePoint
public static org.locationtech.jts.geom.Geometry lineInterpolatePoint(org.locationtech.jts.geom.Geometry geom, double fraction) -
perimeter
public static double perimeter(org.locationtech.jts.geom.Geometry geometry, boolean use_spheroid, boolean lenient) -
perimeter
public static double perimeter(org.locationtech.jts.geom.Geometry geometry, boolean use_spheroid) -
perimeter
public static double perimeter(org.locationtech.jts.geom.Geometry geometry) -
forcePolygonCW
public static org.locationtech.jts.geom.Geometry forcePolygonCW(org.locationtech.jts.geom.Geometry geom) Forces a Polygon/MultiPolygon to use clockwise orientation for the exterior ring and a counter-clockwise for the interior ring(s).- Parameters:
geom-- Returns:
- a clockwise orientated (Multi)Polygon
-
isPolygonCW
public static boolean isPolygonCW(org.locationtech.jts.geom.Geometry geom) This function accepts Polygon and MultiPolygon, if any other type is provided then it will return false. If the exterior ring is clockwise and the interior ring(s) are counter-clockwise then returns true, otherwise false.- Parameters:
geom- Polygon or MultiPolygon- Returns:
-
triangulatePolygon
public static org.locationtech.jts.geom.Geometry triangulatePolygon(org.locationtech.jts.geom.Geometry geom) -
lineLocatePoint
public static double lineLocatePoint(org.locationtech.jts.geom.Geometry geom, org.locationtech.jts.geom.Geometry point) -
locateAlong
public static org.locationtech.jts.geom.Geometry locateAlong(org.locationtech.jts.geom.Geometry linear, double measure, double offset) -
locateAlong
public static org.locationtech.jts.geom.Geometry locateAlong(org.locationtech.jts.geom.Geometry linear, double measure) -
forcePolygonCCW
public static org.locationtech.jts.geom.Geometry forcePolygonCCW(org.locationtech.jts.geom.Geometry geom) Forces a Polygon/MultiPolygon to use counter-clockwise orientation for the exterior ring and a clockwise for the interior ring(s).- Parameters:
geom-- Returns:
- a counter-clockwise orientated (Multi)Polygon
-
isPolygonCCW
public static boolean isPolygonCCW(org.locationtech.jts.geom.Geometry geom) This function accepts Polygon and MultiPolygon, if any other type is provided then it will return false. If the exterior ring is counter-clockwise and the interior ring(s) are clockwise then returns true, otherwise false.- Parameters:
geom- Polygon or MultiPolygon- Returns:
-
addMeasure
public static org.locationtech.jts.geom.Geometry addMeasure(org.locationtech.jts.geom.Geometry geom, double measure_start, double measure_end) -
maxDistance
public static double maxDistance(org.locationtech.jts.geom.Geometry geom1, org.locationtech.jts.geom.Geometry geom2) -
longestLine
public static org.locationtech.jts.geom.Geometry longestLine(org.locationtech.jts.geom.Geometry geom1, org.locationtech.jts.geom.Geometry geom2) -
difference
public static org.locationtech.jts.geom.Geometry difference(org.locationtech.jts.geom.Geometry leftGeometry, org.locationtech.jts.geom.Geometry rightGeometry) -
split
public static org.locationtech.jts.geom.Geometry split(org.locationtech.jts.geom.Geometry input, org.locationtech.jts.geom.Geometry blade) -
dimension
-
project
public static org.locationtech.jts.geom.Geometry project(org.locationtech.jts.geom.Geometry point, double distance, double azimuth, boolean lenient) -
project
public static org.locationtech.jts.geom.Geometry project(org.locationtech.jts.geom.Geometry point, double distance, double azimuth) -
s2CellIDs
get the coordinates of a geometry and transform to Google s2 cell id- Parameters:
input- Geometrylevel- integer, minimum level of cells covering the geometry- Returns:
- List of coordinates
-
s2ToGeom
public static org.locationtech.jts.geom.Geometry[] s2ToGeom(long[] cellIds) - Parameters:
cellIds- array of cell ids- Returns:
- An array of polygons for the cell ids
-
h3CellIDs
public static Long[] h3CellIDs(org.locationtech.jts.geom.Geometry input, int level, boolean fullCover) cover the geometry with H3 cells- Parameters:
input- the input geometrylevel- the resolution of h3 cellsfullCover- whether enforce full cover or not.- Returns:
-
h3CellDistance
public static long h3CellDistance(long cell1, long cell2) return the distance between 2 cells, if the native h3 function doesn't work, use our approximation function for shortest path and use the size - 1 as distance- Parameters:
cell1- source cellcell2- destination cell- Returns:
-
h3KRing
get the neighbor cells of the input cell by h3.gridDisk function- Parameters:
cell- : original cellk- : the k number of rings spread from the original cellexactDistance- : if exactDistance is true, it will only return the cells on the exact kth ring, else will return all 0 - kth neighbors- Returns:
-
h3ToGeom
public static org.locationtech.jts.geom.Geometry[] h3ToGeom(long[] cells) gets the polygon for each h3 index provided- Parameters:
cells- : the set of cells- Returns:
- An Array of Polygons reversed
-
simplify
public static org.locationtech.jts.geom.Geometry simplify(org.locationtech.jts.geom.Geometry geom, double distanceTolerance) -
simplifyPreserveTopology
public static org.locationtech.jts.geom.Geometry simplifyPreserveTopology(org.locationtech.jts.geom.Geometry geometry, double distanceTolerance) -
simplifyVW
public static org.locationtech.jts.geom.Geometry simplifyVW(org.locationtech.jts.geom.Geometry geometry, double tolerance) -
simplifyPolygonHull
public static org.locationtech.jts.geom.Geometry simplifyPolygonHull(org.locationtech.jts.geom.Geometry geometry, double vertexFactor, boolean isOuter) -
simplifyPolygonHull
public static org.locationtech.jts.geom.Geometry simplifyPolygonHull(org.locationtech.jts.geom.Geometry geometry, double vertexFactor) -
geometryType
-
geometryTypeWithMeasured
-
startPoint
public static org.locationtech.jts.geom.Geometry startPoint(org.locationtech.jts.geom.Geometry geometry) -
endPoint
public static org.locationtech.jts.geom.Geometry endPoint(org.locationtech.jts.geom.Geometry geometry) -
dump
public static org.locationtech.jts.geom.Geometry[] dump(org.locationtech.jts.geom.Geometry geometry) -
dumpPoints
public static org.locationtech.jts.geom.Geometry[] dumpPoints(org.locationtech.jts.geom.Geometry geometry) -
symDifference
public static org.locationtech.jts.geom.Geometry symDifference(org.locationtech.jts.geom.Geometry leftGeom, org.locationtech.jts.geom.Geometry rightGeom) -
union
public static org.locationtech.jts.geom.Geometry union(org.locationtech.jts.geom.Geometry leftGeom, org.locationtech.jts.geom.Geometry rightGeom) -
union
public static org.locationtech.jts.geom.Geometry union(org.locationtech.jts.geom.Geometry[] geoms) -
unaryUnion
public static org.locationtech.jts.geom.Geometry unaryUnion(org.locationtech.jts.geom.Geometry geom) -
createMultiGeometryFromOneElement
public static org.locationtech.jts.geom.Geometry createMultiGeometryFromOneElement(org.locationtech.jts.geom.Geometry geometry) -
subDivide
public static org.locationtech.jts.geom.Geometry[] subDivide(org.locationtech.jts.geom.Geometry geometry, int maxVertices) -
segmentize
public static org.locationtech.jts.geom.Geometry segmentize(org.locationtech.jts.geom.Geometry geometry, double maxSegmentLength) -
snap
public static org.locationtech.jts.geom.Geometry snap(org.locationtech.jts.geom.Geometry input, org.locationtech.jts.geom.Geometry reference, double tolerance) -
makeLine
public static org.locationtech.jts.geom.Geometry makeLine(org.locationtech.jts.geom.Geometry geom1, org.locationtech.jts.geom.Geometry geom2) -
makeLine
public static org.locationtech.jts.geom.Geometry makeLine(org.locationtech.jts.geom.Geometry[] geoms) -
makePolygon
public static org.locationtech.jts.geom.Geometry makePolygon(org.locationtech.jts.geom.Geometry shell, org.locationtech.jts.geom.Geometry[] holes) -
makePolygon
public static org.locationtech.jts.geom.Geometry makePolygon(org.locationtech.jts.geom.Geometry shell, org.locationtech.jts.geom.Geometry[] holes, org.locationtech.jts.geom.GeometryFactory factory) -
makepolygonWithSRID
public static org.locationtech.jts.geom.Geometry makepolygonWithSRID(org.locationtech.jts.geom.Geometry lineString, Integer srid) -
createMultiGeometry
public static org.locationtech.jts.geom.Geometry createMultiGeometry(org.locationtech.jts.geom.Geometry[] geometries) -
collectionExtract
public static org.locationtech.jts.geom.Geometry collectionExtract(org.locationtech.jts.geom.Geometry geometry, Integer geomType) -
collectionExtract
public static org.locationtech.jts.geom.Geometry collectionExtract(org.locationtech.jts.geom.Geometry geometry) -
numPoints
- Throws:
Exception
-
force3DM
public static org.locationtech.jts.geom.Geometry force3DM(org.locationtech.jts.geom.Geometry geom, double mValue) -
force3DM
public static org.locationtech.jts.geom.Geometry force3DM(org.locationtech.jts.geom.Geometry geom) -
force4D
public static org.locationtech.jts.geom.Geometry force4D(org.locationtech.jts.geom.Geometry geom, double zValue, double mValue) -
force4D
public static org.locationtech.jts.geom.Geometry force4D(org.locationtech.jts.geom.Geometry geom) -
force3D
public static org.locationtech.jts.geom.Geometry force3D(org.locationtech.jts.geom.Geometry geometry, double zValue) -
force3D
public static org.locationtech.jts.geom.Geometry force3D(org.locationtech.jts.geom.Geometry geometry) -
forceCollection
public static org.locationtech.jts.geom.Geometry forceCollection(org.locationtech.jts.geom.Geometry geom) -
generatePoints
public static org.locationtech.jts.geom.Geometry generatePoints(org.locationtech.jts.geom.Geometry geom, int numPoints, long seed) -
generatePoints
public static org.locationtech.jts.geom.Geometry generatePoints(org.locationtech.jts.geom.Geometry geom, int numPoints) -
generatePoints
public static org.locationtech.jts.geom.Geometry generatePoints(org.locationtech.jts.geom.Geometry geom, int numPoints, Random random) -
nRings
- Throws:
Exception
-
translate
public static org.locationtech.jts.geom.Geometry translate(org.locationtech.jts.geom.Geometry geometry, double deltaX, double deltaY, double deltaZ) -
translate
public static org.locationtech.jts.geom.Geometry translate(org.locationtech.jts.geom.Geometry geometry, double deltaX, double deltaY) -
affine
public static org.locationtech.jts.geom.Geometry affine(org.locationtech.jts.geom.Geometry geometry, double a, double b, double c, double d, double e, double f, double g, double h, double i, double xOff, double yOff, double zOff) -
affine
public static org.locationtech.jts.geom.Geometry affine(org.locationtech.jts.geom.Geometry geometry, double a, double b, double d, double e, double xOff, double yOff) -
geometricMedian
public static org.locationtech.jts.geom.Geometry geometricMedian(org.locationtech.jts.geom.Geometry geometry, double tolerance, int maxIter, boolean failIfNotConverged) throws Exception - Throws:
Exception
-
geometricMedian
public static org.locationtech.jts.geom.Geometry geometricMedian(org.locationtech.jts.geom.Geometry geometry, double tolerance, int maxIter) throws Exception - Throws:
Exception
-
geometricMedian
public static org.locationtech.jts.geom.Geometry geometricMedian(org.locationtech.jts.geom.Geometry geometry, double tolerance) throws Exception - Throws:
Exception
-
geometricMedian
public static org.locationtech.jts.geom.Geometry geometricMedian(org.locationtech.jts.geom.Geometry geometry) throws Exception - Throws:
Exception
-
frechetDistance
public static double frechetDistance(org.locationtech.jts.geom.Geometry g1, org.locationtech.jts.geom.Geometry g2) -
isCollection
public static boolean isCollection(org.locationtech.jts.geom.Geometry geometry) -
boundingDiagonal
public static org.locationtech.jts.geom.Geometry boundingDiagonal(org.locationtech.jts.geom.Geometry geometry) -
angle
public static double angle(org.locationtech.jts.geom.Geometry point1, org.locationtech.jts.geom.Geometry point2, org.locationtech.jts.geom.Geometry point3, org.locationtech.jts.geom.Geometry point4) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
angle
public static double angle(org.locationtech.jts.geom.Geometry point1, org.locationtech.jts.geom.Geometry point2, org.locationtech.jts.geom.Geometry point3) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
angle
public static double angle(org.locationtech.jts.geom.Geometry line1, org.locationtech.jts.geom.Geometry line2) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
degrees
public static double degrees(double angleInRadian) -
hausdorffDistance
public static Double hausdorffDistance(org.locationtech.jts.geom.Geometry g1, org.locationtech.jts.geom.Geometry g2, double densityFrac) -
hausdorffDistance
public static Double hausdorffDistance(org.locationtech.jts.geom.Geometry g1, org.locationtech.jts.geom.Geometry g2) -
isValidDetail
-
isValidDetail
-
isValidReason
-
isValidReason
-
polygonize
public static org.locationtech.jts.geom.Geometry polygonize(org.locationtech.jts.geom.Geometry geometry) This method takes a GeometryCollection and returns another GeometryCollection containing the polygons formed by the linework of a set of geometries.- Parameters:
geometry- A collection of Geometry objects that should contain only linestrings.- Returns:
- A GeometryCollection containing the resultant polygons.
-
points
public static org.locationtech.jts.geom.Geometry points(org.locationtech.jts.geom.Geometry geometry) Creates a MultiPoint containing all coordinates of the given geometry. Duplicates, M and Z coordinates are preserved.- Parameters:
geometry- The input geometry- Returns:
- A MultiPoint geometry
-
scale
public static org.locationtech.jts.geom.Geometry scale(org.locationtech.jts.geom.Geometry geometry, double scaleX, double scaleY) -
scaleGeom
public static org.locationtech.jts.geom.Geometry scaleGeom(org.locationtech.jts.geom.Geometry geometry, org.locationtech.jts.geom.Geometry factor) -
scaleGeom
public static org.locationtech.jts.geom.Geometry scaleGeom(org.locationtech.jts.geom.Geometry geometry, org.locationtech.jts.geom.Geometry factor, org.locationtech.jts.geom.Geometry origin) -
rotateX
public static org.locationtech.jts.geom.Geometry rotateX(org.locationtech.jts.geom.Geometry geometry, double angle) -
rotateY
public static org.locationtech.jts.geom.Geometry rotateY(org.locationtech.jts.geom.Geometry geometry, double angle) -
rotate
public static org.locationtech.jts.geom.Geometry rotate(org.locationtech.jts.geom.Geometry geometry, double angle) Rotates a geometry by a given angle in radians.- Parameters:
geometry- The input geometry to rotate.angle- The angle in radians to rotate the geometry.- Returns:
- The rotated geometry.
-
rotate
public static org.locationtech.jts.geom.Geometry rotate(org.locationtech.jts.geom.Geometry geometry, double angle, double originX, double originY) Rotates a geometry by a given angle in radians around a given origin point (x, y).- Parameters:
geometry- The input geometry to rotate.angle- The angle in radians to rotate the geometry.originX- The x coordinate of the origin point around which to rotate.originY- The y coordinate of the origin point around which to rotate.- Returns:
- The rotated geometry.
-
rotate
public static org.locationtech.jts.geom.Geometry rotate(org.locationtech.jts.geom.Geometry geometry, double angle, org.locationtech.jts.geom.Geometry pointOrigin) Rotates a geometry by a given angle in radians around a given origin point.- Parameters:
geometry- The input geometry to rotate.angle- The angle in radians to rotate the geometry.pointOrigin- The origin point around which to rotate.- Returns:
- The rotated geometry.
- Throws:
IllegalArgumentException- if the pointOrigin is not a Point geometry.
-
interpolatePoint
public static double interpolatePoint(org.locationtech.jts.geom.Geometry geom1, org.locationtech.jts.geom.Geometry geom2) This function returns the m coordinate of the closest point in a LineString to the specified Point.- Parameters:
geom1- The LineString (with or without M values) to be evaluated.geom2- The Point object to find the closest point to.- Returns:
- The interpolated M value of the closest point on the LineString.
-
straightSkeleton
public static org.locationtech.jts.geom.Geometry straightSkeleton(org.locationtech.jts.geom.Geometry geometry) Computes the straight skeleton of an areal geometry. The straight skeleton is a method of representing a polygon by a topological skeleton, formed by a continuous shrinking process where each edge moves inward in parallel at a uniform speed.This implementation uses the campskeleton library which implements the weighted straight skeleton algorithm based on Felkel's approach. The result represents the "skeleton" or centerline of the polygon.
- Parameters:
geometry- The areal geometry (Polygon or MultiPolygon)- Returns:
- A MultiLineString representing the straight skeleton, or null if input is null/empty
-
straightSkeleton
public static org.locationtech.jts.geom.Geometry straightSkeleton(org.locationtech.jts.geom.Geometry geometry, Integer maxVertices) Computes the straight skeleton of an areal geometry with optional vertex simplification.The straight skeleton is a method of representing a polygon by a topological skeleton, formed by a continuous shrinking process where each edge moves inward in parallel at a uniform speed.
For polygons with many vertices, performance can be improved by limiting the vertex count. The algorithm will merge the shortest edges until the vertex count is reduced to the specified limit.
- Parameters:
geometry- The areal geometry (Polygon or MultiPolygon)maxVertices- Maximum number of vertices per polygon (0 to disable simplification). Recommended: 100-500 for performance- Returns:
- A MultiLineString representing the straight skeleton, or null if input is null/empty
-
approximateMedialAxis
public static org.locationtech.jts.geom.Geometry approximateMedialAxis(org.locationtech.jts.geom.Geometry geometry) Computes an approximate medial axis of an areal geometry by computing the straight skeleton and filtering to keep only interior edges.The medial axis is approximated by first computing the straight skeleton, then filtering to keep only edges where both endpoints are interior to the polygon (not on the boundary). This produces a cleaner skeleton by removing branches that extend to the boundary.
- Parameters:
geometry- The areal geometry (Polygon or MultiPolygon)- Returns:
- A MultiLineString representing the approximate medial axis, or null if input is null/empty
-
approximateMedialAxis
public static org.locationtech.jts.geom.Geometry approximateMedialAxis(org.locationtech.jts.geom.Geometry geometry, Integer maxVertices) Computes an approximate medial axis of an areal geometry by computing the straight skeleton and filtering to keep only interior edges, with optional vertex simplification.The medial axis is approximated by first computing the straight skeleton, then filtering to keep only edges where both endpoints are interior to the polygon (not on the boundary). This produces a cleaner skeleton by removing branches that extend to the boundary.
For polygons with many vertices, performance can be improved by limiting the vertex count before computing the skeleton. The algorithm will merge the shortest edges until the vertex count is reduced to the specified limit.
- Parameters:
geometry- The areal geometry (Polygon or MultiPolygon)maxVertices- Maximum number of vertices per polygon (0 to disable simplification). Recommended: 100-500 for performance- Returns:
- A MultiLineString representing the approximate medial axis, or null if input is null/empty
-