public interface Geometry
extends java.lang.Cloneable, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static short |
GEOMETRY_ANNOTATION
Constant for geometry id of type
Annotation. |
static short |
GEOMETRY_COMPLEX
Constant for geometry id of type
Complex. |
static short |
GEOMETRY_ELLIPSE
Constant for geometry id of type
Ellipse. |
static short |
GEOMETRY_LINE
Constant for geometry id of type
Line. |
static short |
GEOMETRY_LINEAR_RING
Constant for geometry id of type
LinearRing. |
static short |
GEOMETRY_LINESTRING
Constant for geometry id of type
LineString. |
static short |
GEOMETRY_MULTI_ANNOTATION
Constant for geometry id of type
MultiAnnotation. |
static short |
GEOMETRY_MULTI_LINESTRING
Constant for geometry id of type
MultiLineString. |
static short |
GEOMETRY_MULTI_POINT
Constant for geometry id of type
MultiPoint. |
static short |
GEOMETRY_MULTI_POLYGON
Constant for geometry id of type
MultiPolygon. |
static short |
GEOMETRY_POINT
Constant for geometry id of type
Point. |
static short |
GEOMETRY_POLYGON
Constant for geometry id of type
Polygon. |
static short |
GEOMETRY_RECTANGLE
Constant for geometry id of type
Rectangle. |
| Modifier and Type | Method and Description |
|---|---|
default double |
area()
Returns the geometry area.
|
java.lang.String |
asText() |
Geometry |
boundary()
Returns the boundary of this geometry as a line string.
|
Geometry |
clone()
Clones this geometry.
|
void |
createBounds()
Updates the geometry bounds from the current geometry.
|
Rectangle |
getBounds()
Returns the minimum bounding rectangle of this geometry.
|
Point |
getCenteredPoint()
This method returns a point that is typically centered on the geometry.
|
short |
getGeometryId()
Returns the geometry class id.
|
int |
getGeometryType()
Returns the geometry type for this geometry.
|
default double |
length()
Returns the geometry length.
|
Point[] |
serialize()
Returns this geometry as an array of Point.
|
int |
sizeOf()
Returns an approximation in bytes of the memory used by this geometry.
|
boolean |
spatiallyEquals(Geometry geometry)
Deprecated.
|
boolean |
spatiallyEquals(Geometry geometry,
PrecisionModel precisionModel)
Tests if this geometry is equal to the argument, on a topological point of view.
|
java.lang.String |
toString()
Returns informations about the current geometry.
|
Geometry |
transform(Transformation tr)
Creates a clone of the current geometry and returns
the new instance transformed with the specified geometry transformation.
The returned geometry can be of any geometry types after the transformation. |
void |
translate(double dx,
double dy)
Translate this geometry with the specified values.
|
static final short GEOMETRY_POINT
Point.Point,
Constant Field Valuesstatic final short GEOMETRY_MULTI_POINT
MultiPoint.MultiPoint,
Constant Field Valuesstatic final short GEOMETRY_LINESTRING
LineString.LineString,
Constant Field Valuesstatic final short GEOMETRY_MULTI_LINESTRING
MultiLineString.MultiLineString,
Constant Field Valuesstatic final short GEOMETRY_LINE
Line.Line,
Constant Field Valuesstatic final short GEOMETRY_POLYGON
Polygon.Polygon,
Constant Field Valuesstatic final short GEOMETRY_MULTI_POLYGON
MultiPolygon.MultiPolygon,
Constant Field Valuesstatic final short GEOMETRY_LINEAR_RING
LinearRing.LinearRing,
Constant Field Valuesstatic final short GEOMETRY_COMPLEX
Complex.Complex,
Constant Field Valuesstatic final short GEOMETRY_RECTANGLE
Rectangle.Rectangle,
Constant Field Valuesstatic final short GEOMETRY_ANNOTATION
Annotation.Annotation,
Constant Field Valuesstatic final short GEOMETRY_ELLIPSE
Ellipse.Ellipse,
Constant Field Valuesstatic final short GEOMETRY_MULTI_ANNOTATION
MultiAnnotation.MultiAnnotation,
Constant Field ValuesRectangle getBounds()
Point[] serialize()
Geometry clone()
@Deprecated boolean spatiallyEquals(Geometry geometry)
geometry - the geometry to be tested.boolean spatiallyEquals(Geometry geometry, PrecisionModel precisionModel)
geometry - the geometry to be tested.precisionModel - the precision model to use while comparing geometries.Geometry boundary()
java.lang.String toString()
toString in class java.lang.Objectvoid translate(double dx,
double dy)
dx - translation on the X-axis.dy - translation on the Y-axis.int sizeOf()
short getGeometryId()
int getGeometryType()
for more details.Geometry transform(Transformation tr)
tr - the transformation to apply.void createBounds()
Point getCenteredPoint()
java.lang.String asText()
default double area()
default double length()