public class JTSGeometryOperations extends Object implements ProjectedGeometryOperations
ProjectedGeometryOperations
that delegates to the corresponding JTS operations.Default
Constructor and Description |
---|
JTSGeometryOperations() |
Modifier and Type | Method and Description |
---|---|
<P extends C2D,G extends Geometry<P> & Polygonal<P>> |
area(G geometry)
Calculates the area of the specified
Geometry . |
<P extends C2D> |
boundary(Geometry<P> geometry)
Calculates the boundary of the specified
Geometry . |
<P extends C2D> |
buffer(Geometry<P> geometry,
double distance)
Calculates a
Geometry that represents all points whose distance from the specified
Geometry is less than or equal the specified distance. |
<P extends C2D,G extends Geometry<P> & Polygonal<P>> |
centroid(G geometry)
Calculates a centroid for the specified
Geometry . |
<P extends C2D> |
contains(Geometry<P> geometry,
Geometry<P> other)
Checks if the first specified
Geometry spatially
contains the second. |
<P extends C2D> |
convexHull(Geometry<P> geometry)
Calculates the convex hull of the specified
Geometry . |
<P extends C2D> |
crosses(Geometry<P> geometry,
Geometry<P> other)
Checks if the specified
Geometry s cross. |
<P extends C2D> |
difference(Geometry<P> geometry,
Geometry<P> other)
Calculates the point set difference of the specified
Geometry s. |
<P extends C2D> |
distance(Geometry<P> geometry,
Geometry<P> other)
Calculates the shortest distance between any two points in the two
Geometry s in the
coordinate reference system of this Geometry . |
<P extends C2D> |
intersection(Geometry<P> geometry,
Geometry<P> other)
Calculates the point set intersection of the specified
Geometry s. |
<P extends C2D> |
intersects(Geometry<P> geometry,
Geometry<P> other)
Checks if the specified
Geometry s intersect. |
<P extends C2D> |
isSimple(Geometry<P> geometry)
Tests the simplicity of the specified
Geometry . |
<P extends C2D,G extends Geometry<P> & Linear<P>> |
length(G geometry)
Calculates the length of the specified
Geometry . |
<P extends C2D> |
overlaps(Geometry<P> geometry,
Geometry<P> other)
Checks if the specified
Geometry s overlap. |
<P extends C2D> |
relates(Geometry<P> geometry,
Geometry<P> other,
String matrix)
Checks if the specified
Geometry s are spatially related by testing
for intersections between the interior, boundary and exterior of the two geometric objects as specified by
the values in the intersection pattern matrix. |
<P extends C2D,G extends Geometry<P>> |
reverse(G geometry)
Creates a
Geometry having as coordinates the coordinates of the input Geometry in reverse order. |
<P extends C2D> |
symmetricDifference(Geometry<P> geometry,
Geometry<P> other)
Calculates the point set symmetric difference of the specified
Geometry s. |
<P extends C2D> |
touches(Geometry<P> geometry,
Geometry<P> other)
Checks if the specified
Geometry s touch. |
<P extends C2D> |
union(Geometry<P> geometry,
Geometry<P> other)
Calculates the point set union of the specified
Geometry s. |
public <P extends C2D> boolean isSimple(Geometry<P> geometry)
ProjectedGeometryOperations
Geometry
.isSimple
in interface ProjectedGeometryOperations
geometry
- the Geometry
to test for simplicity.Geometry
is simple.public <P extends C2D> Geometry<P> boundary(Geometry<P> geometry)
ProjectedGeometryOperations
Geometry
.boundary
in interface ProjectedGeometryOperations
geometry
- the Geometry
for which to calculate the boundary.Geometry
representing the boundary of the specified Geometry
.public <P extends C2D,G extends Geometry<P>> G reverse(G geometry)
Geometry
having as coordinates the coordinates of the input Geometry
in reverse order.reverse
in interface ProjectedGeometryOperations
geometry
- the Geometry
to reverseGeometry
with the same coordinates as the specified input Geometry
but in reverse orderpublic <P extends C2D> boolean intersects(Geometry<P> geometry, Geometry<P> other)
ProjectedGeometryOperations
Geometry
s intersect.intersects
in interface ProjectedGeometryOperations
geometry
- the first Geometry
operand of the intersection testother
- the second Geometry
operand of the intersection testGeometry
s spatially intersectpublic <P extends C2D> boolean touches(Geometry<P> geometry, Geometry<P> other)
ProjectedGeometryOperations
Geometry
s touch.touches
in interface ProjectedGeometryOperations
geometry
- the first Geometry
operand of the touch testother
- the second Geometry
operand of the touch testGeometry
s spatially touchpublic <P extends C2D> boolean crosses(Geometry<P> geometry, Geometry<P> other)
ProjectedGeometryOperations
Geometry
s cross.crosses
in interface ProjectedGeometryOperations
geometry
- the first Geometry
operand of the cross testother
- the second Geometry
operand of the cross testGeometry
s spatially crosspublic <P extends C2D> boolean contains(Geometry<P> geometry, Geometry<P> other)
ProjectedGeometryOperations
Geometry
spatially
contains the second.contains
in interface ProjectedGeometryOperations
geometry
- the first Geometry
operand of the containment testother
- the second Geometry
operand of the containment testGeometry
spatially contains the secondpublic <P extends C2D> boolean overlaps(Geometry<P> geometry, Geometry<P> other)
ProjectedGeometryOperations
Geometry
s overlap.overlaps
in interface ProjectedGeometryOperations
geometry
- the first Geometry
operand of the overlap testother
- the second Geometry
operand of the overlap testGeometry
s spatially overlappublic <P extends C2D> boolean relates(Geometry<P> geometry, Geometry<P> other, String matrix)
ProjectedGeometryOperations
Geometry
s are spatially related by testing
for intersections between the interior, boundary and exterior of the two geometric objects as specified by
the values in the intersection pattern matrix. This returns false if all the tested intersections are empty except
exterior (this) intersect exterior (another).relates
in interface ProjectedGeometryOperations
geometry
- the first Geometry
operand of the relates testother
- the second Geometry
operand of the relates testmatrix
- the intersection pattern matrixGeometry
public <P extends C2D> double distance(Geometry<P> geometry, Geometry<P> other)
ProjectedGeometryOperations
Geometry
s in the
coordinate reference system of this Geometry
. Only the X/Y-coordinates are used in the distance
calculation; M- and Z-coordinates are ignored.distance
in interface ProjectedGeometryOperations
geometry
- the first Geometry
other
- the second Geometry
Geometries
public <P extends C2D> Geometry<P> buffer(Geometry<P> geometry, double distance)
ProjectedGeometryOperations
Geometry
that represents all points whose distance from the specified
Geometry
is less than or equal the specified distance.
Calculations are in the CoordinateReferenceSystem
of this
Geometry
.
Z- or M-coordinates are ignored in the buffering operation; and the result will always be a 2D geometry.
buffer
in interface ProjectedGeometryOperations
geometry
- the Geometry
for which to calculate the bufferdistance
- the buffer distanceGeometry
representing the buffer of the specified Geometry
with the specified distance.public <P extends C2D> Geometry<P> convexHull(Geometry<P> geometry)
ProjectedGeometryOperations
Geometry
.convexHull
in interface ProjectedGeometryOperations
geometry
- the Geometry
for which to calculate the convex hull.Geometry
.public <P extends C2D> Geometry<P> intersection(Geometry<P> geometry, Geometry<P> other)
ProjectedGeometryOperations
Geometry
s.intersection
in interface ProjectedGeometryOperations
geometry
- the first Geometry
other
- the second Geometry
Geometry
representing the point set intersection between the two specified Geometries
public <P extends C2D> Geometry<P> union(Geometry<P> geometry, Geometry<P> other)
ProjectedGeometryOperations
Geometry
s.union
in interface ProjectedGeometryOperations
geometry
- the first Geometry
other
- the second Geometry
Geometry
representing the point set union between the two specified Geometries
public <P extends C2D> Geometry<P> difference(Geometry<P> geometry, Geometry<P> other)
ProjectedGeometryOperations
Geometry
s.difference
in interface ProjectedGeometryOperations
geometry
- the first Geometry
other
- the second Geometry
Geometry
representing the point set difference between the two specified Geometries
public <P extends C2D> Geometry<P> symmetricDifference(Geometry<P> geometry, Geometry<P> other)
ProjectedGeometryOperations
Geometry
s.symmetricDifference
in interface ProjectedGeometryOperations
geometry
- the first Geometry
other
- the second Geometry
Geometry
representing the point set symmetric difference between the two specified Geometries
public <P extends C2D,G extends Geometry<P> & Linear<P>> double length(G geometry)
ProjectedGeometryOperations
Geometry
.length
in interface ProjectedGeometryOperations
geometry
- the Geometrypublic <P extends C2D,G extends Geometry<P> & Polygonal<P>> double area(G geometry)
ProjectedGeometryOperations
Geometry
.area
in interface ProjectedGeometryOperations
geometry
- the Geometrypublic <P extends C2D,G extends Geometry<P> & Polygonal<P>> Point<P> centroid(G geometry)
ProjectedGeometryOperations
Geometry
.centroid
in interface ProjectedGeometryOperations
G
- Polygonal Geometrygeometry
- the GeometryPoint
Copyright © 2018 geolatte.org. All rights reserved.