Package mil.nga.sf
Class Geometry
- java.lang.Object
-
- mil.nga.sf.Geometry
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Curve
,GeometryCollection
,Point
,Surface
public abstract class Geometry extends Object implements Serializable
The root of the geometry type hierarchy- Author:
- osbornb
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Geometry(GeometryType geometryType, boolean hasZ, boolean hasM)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Geometry
copy()
Copy the geometryboolean
equals(Object obj)
void
expandEnvelope(GeometryEnvelope envelope)
Expand the envelope with the minimum bounding box for this GeometryPoint
getCentroid()
Get the mathematical centroid point of a 2 dimensional representation of the Geometry (balancing point of a 2d cutout of the geometry).Point
getDegreesCentroid()
Get the geographic centroid point of a 2 dimensional representation of the degree unit Geometry.int
getDimension()
Get the inherent dimension (0, 1, or 2) for this GeometryGeometryEnvelope
getEnvelope()
Get the minimum bounding box for this GeometryGeometryType
getGeometryType()
Get the geometry typeint
hashCode()
boolean
hasM()
Does the geometry have m coordinatesboolean
hasZ()
Does the geometry have z coordinatesboolean
is3D()
Does the geometry have z coordinatesabstract boolean
isEmpty()
Is the Geometry emptyboolean
isMeasured()
Does the geometry have m coordinates.abstract boolean
isSimple()
Determine if this Geometry has no anomalous geometric points, such as self intersection or self tangencyvoid
setHasM(boolean hasM)
Set if the geometry has m coordinatesvoid
setHasZ(boolean hasZ)
Set if the geometry has z coordinatesprotected void
updateZM(Geometry geometry)
Update currently false hasZ and hasM values using the provided geometry
-
-
-
Constructor Detail
-
Geometry
protected Geometry(GeometryType geometryType, boolean hasZ, boolean hasM)
Constructor- Parameters:
geometryType
- geometry typehasZ
- has zhasM
- has m
-
-
Method Detail
-
getGeometryType
public GeometryType getGeometryType()
Get the geometry type- Returns:
- geometry type
-
hasZ
public boolean hasZ()
Does the geometry have z coordinates- Returns:
- true if has z coordinates
-
setHasZ
public void setHasZ(boolean hasZ)
Set if the geometry has z coordinates- Parameters:
hasZ
- true if has z coordinates- Since:
- 2.0.3
-
is3D
public boolean is3D()
Does the geometry have z coordinates- Returns:
- true if has z coordinates
- See Also:
hasZ()
-
hasM
public boolean hasM()
Does the geometry have m coordinates- Returns:
- true if has m coordinates
-
setHasM
public void setHasM(boolean hasM)
Set if the geometry has m coordinates- Parameters:
hasM
- true if has m coordinates- Since:
- 2.0.3
-
updateZM
protected void updateZM(Geometry geometry)
Update currently false hasZ and hasM values using the provided geometry- Parameters:
geometry
- geometry- Since:
- 2.0.3
-
isMeasured
public boolean isMeasured()
Does the geometry have m coordinates.- Returns:
- true if has m coordinates
- See Also:
hasM()
-
getEnvelope
public GeometryEnvelope getEnvelope()
Get the minimum bounding box for this Geometry- Returns:
- geometry envelope
-
expandEnvelope
public void expandEnvelope(GeometryEnvelope envelope)
Expand the envelope with the minimum bounding box for this Geometry- Parameters:
envelope
- geometry envelope to expand- Since:
- 2.0.5
-
getDimension
public int getDimension()
Get the inherent dimension (0, 1, or 2) for this Geometry- Returns:
- dimension
-
getCentroid
public Point getCentroid()
Get the mathematical centroid point of a 2 dimensional representation of the Geometry (balancing point of a 2d cutout of the geometry). Only the x and y coordinate of the resulting point are calculated and populated. The resultingPoint.getZ()
andPoint.getM()
methods will always return null.- Returns:
- centroid point
-
getDegreesCentroid
public Point getDegreesCentroid()
Get the geographic centroid point of a 2 dimensional representation of the degree unit Geometry. Only the x and y coordinate of the resulting point are calculated and populated. The resultingPoint.getZ()
andPoint.getM()
methods will always return null.- Returns:
- centroid point
- Since:
- 2.0.5
-
copy
public abstract Geometry copy()
Copy the geometry- Returns:
- geometry copy
-
isEmpty
public abstract boolean isEmpty()
Is the Geometry empty- Returns:
- true if empty
-
isSimple
public abstract boolean isSimple()
Determine if this Geometry has no anomalous geometric points, such as self intersection or self tangency- Returns:
- true if simple
-
-