class Geometry extends java.lang.Object
The base class for other Geometries.
Type | Name and description |
---|---|
static int |
CAP_BUTT Butt Buffer cap style |
static int |
CAP_ROUND Round Buffer cap style |
static int |
CAP_SQUARE Square Buffer cap style |
static GeometryFactory |
factory The JTS GeometryFactory used to create JTS Geometry |
Geometry |
g The wrapped JTS Geometry |
static PreparedGeometryFactory |
preparedFactory The JTS PreparedGeometryFactory used to create prepared JTS Geometry |
Type Params | Return Type | Name and description |
---|---|---|
|
java.lang.Object |
asType(java.lang.Class type) Override the asType method to convert Geometry to a custom value |
|
Geometry |
buffer(double distance, int quadrantSegments, int endCapStyle) Buffer the Geometry by some distance. |
|
static Geometry |
cascadedUnion(java.util.List<Polygon> polygons) Perform a cascaded union on a List of Polygons |
|
Geometry |
concaveHull(double maxLength) Calculate the concave hull |
|
Geometry |
concaveHullOfPolygons(double maxLength) Calculate the concave hull of polygons |
|
boolean |
contains(Geometry other) Whether this Geometry contains the other Geometry. |
|
boolean |
coveredBy(Geometry other) Whether this Geometry is covered by the other Geometry |
|
boolean |
covers(Geometry other) Whether this Geometry covers the other Geometry |
|
static Geometry |
createFromText(java.lang.String text, java.lang.String fontName, int size) Create a Geometry from a text and font. |
|
static Geometry |
createKochSnowflake(Bounds bounds, int numberOfPoints) Create a Koch Snowflake Geometry |
|
static Geometry |
createRandomPoints(Geometry geometry, int number) Create the given number of randomly located points inside of the given Geometry |
|
static Geometry |
createRandomPointsInGrid(Bounds bounds, int number, boolean constrainedToCircle, double gutterFraction) Create the given number of randomly located points inside of the given Geometry and also constrained by the cells of a grid. |
|
static Geometry |
createSierpinskiCarpet(Bounds bounds, int numberOfPoints) Create a Sierpinski Carpet Geometry |
|
boolean |
crosses(Geometry other) Whether this Geometry crosses the other Geometry |
|
Geometry |
densify(double distance) Densify this Geometry |
|
Geometry |
difference(Geometry other) Calculate the difference between this Geometry and the other Geometry |
|
boolean |
disjoint(Geometry other) Whether this Geometry is disjoint from the other Geometry |
|
double |
distance(Geometry other) Calculate the distance between this Geometry and other Geometry |
|
boolean |
equals(java.lang.Object obj) Whether this Geometry equals another Object |
|
boolean |
equalsNorm(Geometry geometry) Whether this Geometry equals another Geometry after they are both normalized |
|
boolean |
equalsTopo(Geometry geometry) Whether this Geometry topologically equals another Geometry |
|
Geometry |
fix() Fix an invalid Geometry |
|
static Geometry |
fromString(java.lang.String str) Get a Geometry from a String with an unknown format. |
|
double |
getArea() Get the area of this Geometry |
|
java.lang.Object |
getAt(int index) Get the sub Geometry at the specified index. |
|
Geometry |
getBoundary() Get the boundary of this Geometry |
|
Bounds |
getBounds() Get the Bounds of this Geometry |
|
Point |
getCentroid() Calculate the centroid of this Geometry. |
|
Geometry |
getConvexHull() Calculate the convex hull of this Geometry |
|
Coordinate[] |
getCoordinates() Get the Array of Coordinates |
|
Geometry |
getDelaunayTriangleDiagram(boolean isConforming) Get Delaunay Triangle Diagram for this Geometry |
|
int |
getDimension() Get the dimension of the Geometry |
|
Envelope |
getEnvelope() Calculate the envelope of this Geometry |
|
Envelope |
getEnvelopeInternal() Calculate the internal Envelope of this Geometry |
|
java.util.List<Geometry> |
getGeometries() Get a List of all Geometries |
|
Geometry |
getGeometryN(int n) Get the nth Geometry in this Geometry |
|
java.lang.String |
getGeometryType() Get the name of the Geometry type |
|
Point |
getInteriorPoint() Get the interior Point of this Geometry |
|
Geometry |
getLargestEmptyCircle(double tolerance) Get the largest empty circle for this Geometry |
|
double |
getLength() Get the length of this Geometry |
|
Geometry |
getMaximumInscribedCircle(double tolerance) Get the maximum inscribed circle for this Geometry |
|
Geometry |
getMinimumBoundingCircle() Get the Minimum Bounding Circle |
|
Geometry |
getMinimumClearance() Get the minimum clearance of this Geometry as a LineString |
|
Geometry |
getMinimumDiameter() Get the minimum diameter of this Geometry as a LineString |
|
Geometry |
getMinimumRectangle() Get the minimum enclosing rectangle |
|
java.util.List<Point> |
getNearestPoints(Geometry other) Find the nearest Points between this Geometry and another Geometry |
|
Geometry |
getNorm() Get a normalized copy of this Geometry |
|
int |
getNumGeometries() Get the number of Geometries in this Geometry |
|
int |
getNumPoints() Get the number of Points in this Geometry |
|
Geometry |
getOctagonalEnvelope() Get the octagonal envelope for this Geometry |
|
java.util.List<Point> |
getPoints() Get a List of Points that make up this Geometry |
|
java.lang.String |
getValidReason() Get the reason why this Geometry is invalid. |
|
Geometry |
getVoronoiDiagram() Get the Voronoi Diagram for this Geometry |
|
int |
hashCode() Calculate this Geometry's hashCode |
|
Geometry |
intersection(Geometry other) Calculate the intersection between this Geometry and the other Geometry |
|
boolean |
intersects(Geometry other) Whether this Geometry intersects the other Geometry |
|
boolean |
isCurved() Whether this Geometry is curved |
|
boolean |
isEmpty() Whether this Geometry is empty |
|
boolean |
isRectangle() Whether this Geometry is rectangular |
|
boolean |
isSimple() Whether this Geometry is simple |
|
boolean |
isValid() Whether this Geometry is valid |
|
boolean |
isWithinDistance(Geometry geom, double distance) Whether this Geometry is within the given distance of the other Geometry |
|
void |
normalize() Normalize this Geometry |
|
Geometry |
offset(double distance, int quadrantSegments) Create a new Geometry where all LineStrings are offset by the given distance. |
|
Geometry |
offsetCurve(double distance) Calculate an offset curve |
|
boolean |
overlaps(Geometry other) Whether this Geometry overlaps the other Geometry |
|
PreparedGeometry |
prepare() Get a PreparedGeometry for this Geometry. |
|
static PreparedGeometry |
prepare(Geometry g) Get a PreparedGeometry for the given Geometry |
|
Geometry |
reducePrecision(Map options, java.lang.String type) Reduce the precision of this Geometry. |
|
Geometry |
reflect(double x, double y) Reflect the Geometry about the line (0 0, x y) |
|
Geometry |
reflect(double x1, double y1, double x2, double y2) Reflect the Geometry about the line (x1 y1, x2 y2) |
|
IntersectionMatrix |
relate(Geometry other) Calculate the D9 Intersection Matrix of this Geometry with the other Geometry. |
|
boolean |
relate(Geometry other, java.lang.String intersectionPattern) Whether this Geometry relates with the other Geometry given a D9 intesection matrix pattern. |
|
Geometry |
rotate(double theta) Rotate the current Geometry around it's origin by a given angle theta(in radians) |
|
Geometry |
rotate(double sin, double cos) Rotate the current Geometry around it's origin by a given angle theta(in radians) |
|
Geometry |
rotate(double theta, double x, double y) Rotate the current Geometry around the xy coordinate by a given angle theta(in radians) |
|
Geometry |
rotate(double sin, double cos, double x, double y) Rotate the current Geometry around the xy coordinate by a given angle theta(in radians) |
|
Geometry |
scale(double xScale, double yScale) Scale the Geometry relative to the origin |
|
Geometry |
scale(double xScale, double yScale, double x, double y) Scale the Geometry relative to the origin |
|
Geometry |
shear(double xShear, double yShear) Shear the Geometry in X and Y direction |
|
Geometry |
simplify(double tolerance) Simplify this Geometry using the Douglas Peucker Simplifier. |
|
Geometry |
simplifyPreservingTopology(double tolerance) Simplify this Geometry preserving topology. |
|
Geometry |
singleSidedBuffer(double distance, int quadrantSegments, int endCapStyle) Create a single sided buffer (+ for right side, - for left side) |
|
Geometry |
smooth(double fit) Smooth this Geometry |
|
Geometry |
snap(Geometry other, double distance) Snap this Geometry to the other Geometry within the given distance |
|
Geometry |
symDifference(Geometry other) Calculate the symmetric difference between this Geometry and the other Geometry |
|
java.lang.String |
toString() The string representation |
|
boolean |
touches(Geometry other) Whether this Geometry touches the other Geometry |
|
Geometry |
translate(double x, double y) Translate the Geometry. |
|
Geometry |
triangulate() Triangulate the Geometry |
|
Geometry |
union() Calculate the union of this Geometry |
|
Geometry |
union(Geometry other) Calculate the union of this Geometry with the other Geometry |
|
Geometry |
variableBuffer(java.util.List<java.lang.Double> distances) Buffer the Geometry with variable sizes |
|
boolean |
within(Geometry other) Whether this Geometry is within the other Geometry |
|
static Geometry |
wrap(Geometry jts) Wrap a JTS Geometry in a geoscript.geom.Geometry |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Butt Buffer cap style
Round Buffer cap style
Square Buffer cap style
The JTS GeometryFactory used to create JTS Geometry
The wrapped JTS Geometry
The JTS PreparedGeometryFactory used to create prepared JTS Geometry
Create a new Geometry wrapping a JTS Geometry
g
- The JTS GeometryOverride the asType method to convert Geometry to a custom value
type
- The ClassBuffer the Geometry by some distance.
distance
- The buffer distancequadrantSegments
- The number of quadrant segments (the default is 8)endCapStyle
- The end cap style (CAP_ROUND is default, also CAP_BUTT, or CAP_SQUARE)Perform a cascaded union on a List of Polygons
polygons
- The PolygonsCalculate the concave hull
maxLength
- The max lengthCalculate the concave hull of polygons
maxLength
- The max lengthWhether this Geometry contains the other Geometry.
other
- The other GeometryWhether this Geometry is covered by the other Geometry
The
- other GeometryWhether this Geometry covers the other Geometry
The
- other GeometryCreate a Geometry from a text and font.
text
- The textfontName
- The font namesize
- The font sizeCreate a Koch Snowflake Geometry
Bounds
- The BoundsnumberOfPoints
- The number of pointsCreate the given number of randomly located points inside of the given Geometry
geometry
- The Geometry that will contain the randomly located pointsnumber
- The number of pointsCreate the given number of randomly located points inside of the given Geometry and also constrained by the cells of a grid. Often more points will be generated that the number given because of the required grid size.
bounds
- The Bounds that will contain the randomly located pointsnumber
- The number of pointsconstrainedToCircle
- Whether the points should be constrained to a circle or notgutterFraction
- The size of the gutter between cellsCreate a Sierpinski Carpet Geometry
Bounds
- The BoundsnumberOfPoints
- The number of pointsWhether this Geometry crosses the other Geometry
The
- other GeometryDensify this Geometry
distance
- The distance between coordinatesCalculate the difference between this Geometry and the other Geometry
The
- other GeometryWhether this Geometry is disjoint from the other Geometry
The
- other GeometryCalculate the distance between this Geometry and other Geometry
The
- other GeometryWhether this Geometry equals another Object
obj
- The ObjectWhether this Geometry equals another Geometry after they are both normalized
geometry
- The other GeometryWhether this Geometry topologically equals another Geometry
geometry
- The other GeometryFix an invalid Geometry
Get a Geometry from a String with an unknown format.
str
- The StringGet the area of this Geometry
Get the sub Geometry at the specified index. This allows support for Groovy's multiple assignment.
def p1 = new Point(111,-47)
def (x,y) = p1
Get the boundary of this Geometry
Get the Bounds of this Geometry
Calculate the centroid of this Geometry.
Calculate the convex hull of this Geometry
Get the Array of Coordinates
Get Delaunay Triangle Diagram for this Geometry
Get the dimension of the Geometry
Calculate the envelope of this Geometry
Calculate the internal Envelope of this Geometry
Get a List of all Geometries
Get the nth Geometry in this Geometry
n
- The index of the GeometryGet the name of the Geometry type
Get the interior Point of this Geometry
Get the largest empty circle for this Geometry
tolerance
- The tolerance which defaults to 1.0Get the length of this Geometry
Get the maximum inscribed circle for this Geometry
tolerance
- The tolerance which defaults to 1.0Get the Minimum Bounding Circle
Get the minimum clearance of this Geometry as a LineString
Get the minimum diameter of this Geometry as a LineString
Get the minimum enclosing rectangle
Find the nearest Points between this Geometry and another Geometry
other
- The other GeometryGet a normalized copy of this Geometry
Get the number of Geometries in this Geometry
Get the number of Points in this Geometry
Get the octagonal envelope for this Geometry
Get a List of Points that make up this Geometry
Get the reason why this Geometry is invalid.
Get the Voronoi Diagram for this Geometry
Calculate this Geometry's hashCode
Calculate the intersection between this Geometry and the other Geometry
The
- other GeometryWhether this Geometry intersects the other Geometry
The
- other GeometryWhether this Geometry is curved
Whether this Geometry is empty
Whether this Geometry is rectangular
Whether this Geometry is simple
Whether this Geometry is valid
Whether this Geometry is within the given distance of the other Geometry
geom
- The other Geometrydistance
- The distanceNormalize this Geometry
Create a new Geometry where all LineStrings are offset by the given distance. Positive distances will offset to the right. Negative distance will offset to the left.
distance
- The offset distancequadrantSegments
- The number of quadrant segements which defaults to 8Calculate an offset curve
distance
- The distance to offsetWhether this Geometry overlaps the other Geometry
other
- The other GeometryGet a PreparedGeometry for this Geometry.
Get a PreparedGeometry for the given Geometry
g
- The GeometryReduce the precision of this Geometry.
options
- Options can include scale (used when type is 'fixed'), pointwise (whether the reductions occurs
pointwise or not), or removecollapsed (whether collapsed geometries should be removed)type
- The precision model type (fixed, floating, or floating_single)Reflect the Geometry about the line (0 0, x y)
x
- The x coordinatey
- The y coordinateReflect the Geometry about the line (x1 y1, x2 y2)
x1
- The x cordinate of the first coordinatey1
- The y cordinate of the first coordinatex2
- The x cordinate of the second coordinatey2
- The y cordinate of the second coordinateCalculate the D9 Intersection Matrix of this Geometry with the other Geometry.
other
- The other GeometryWhether this Geometry relates with the other Geometry given a D9 intesection matrix pattern.
other
- The other GeometryintersectionPattern
- The intersection patternRotate the current Geometry around it's origin by a given angle theta(in radians)
theta
- The angle of rotation in radiansRotate the current Geometry around it's origin by a given angle theta(in radians)
sin
- The sin of the angle of rotation in radianscos
- The cos of the angle of rotation in radiansRotate the current Geometry around the xy coordinate by a given angle theta(in radians)
theta
- The angle of rotation in radiansx
- The x coordinatey
- The y coordinateRotate the current Geometry around the xy coordinate by a given angle theta(in radians)
sin
- The sin of the angle of rotation in radianscos
- The cos of the angle of rotation in radiansx
- The x coordinatey
- The y coordinateScale the Geometry relative to the origin
xScale
- The x direction valueyScale
- The y direction valueScale the Geometry relative to the origin
xScale
- The x direction valueyScale
- The y direction valuex
- The x coordinatey
- The y coordinateShear the Geometry in X and Y direction
xShear
- The distance to shear in the x directionyShear
- The distance to shear in the y directionSimplify this Geometry using the Douglas Peucker Simplifier.
tolerance
- The distance toleranceSimplify this Geometry preserving topology.
tolerance
- The distance toleranceCreate a single sided buffer (+ for right side, - for left side)
distance
- The buffer distancequadrantSegments
- The number of quadrant segments (the default is 8)endCapStyle
- THe end cap style (CAP_ROUND is default, also CAP_BUTT, or CAP_SQUARE)Smooth this Geometry
fit
- The amount of smoothing (between 0 - more and 1 - less)Snap this Geometry to the other Geometry within the given distance
other
- The other Geometrydistance
- The snap distanceCalculate the symmetric difference between this Geometry and the other Geometry
other
- The other GeometryThe string representation
Whether this Geometry touches the other Geometry
other
- The other GeometryTranslate the Geometry.
x
- The distance in the x directiony
- The distance in the y directionTriangulate the Geometry
Calculate the union of this Geometry
Calculate the union of this Geometry with the other Geometry
other
- The other GeometryBuffer the Geometry with variable sizes
distances
- A List of buffer distancesWhether this Geometry is within the other Geometry
other
- The other GeometryGroovy Documentation