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 protectedGeometry(GeometryType geometryType, boolean hasZ, boolean hasM)Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Geometrycopy()Copy the geometrybooleanequals(Object obj)voidexpandEnvelope(GeometryEnvelope envelope)Expand the envelope with the minimum bounding box for this GeometryPointgetCentroid()Get the mathematical centroid point of a 2 dimensional representation of the Geometry (balancing point of a 2d cutout of the geometry).PointgetDegreesCentroid()Get the geographic centroid point of a 2 dimensional representation of the degree unit Geometry.intgetDimension()Get the inherent dimension (0, 1, or 2) for this GeometryGeometryEnvelopegetEnvelope()Get the minimum bounding box for this GeometryGeometryTypegetGeometryType()Get the geometry typeinthashCode()booleanhasM()Does the geometry have m coordinatesbooleanhasZ()Does the geometry have z coordinatesbooleanis3D()Does the geometry have z coordinatesabstract booleanisEmpty()Is the Geometry emptybooleanisMeasured()Does the geometry have m coordinates.abstract booleanisSimple()Determine if this Geometry has no anomalous geometric points, such as self intersection or self tangencyvoidsetHasM(boolean hasM)Set if the geometry has m coordinatesvoidsetHasZ(boolean hasZ)Set if the geometry has z coordinatesprotected voidupdateZM(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
-
-