Package io.github.sebasbaumh.postgis
Klasse Point
java.lang.Object
io.github.sebasbaumh.postgis.Geometry
io.github.sebasbaumh.postgis.Point
- Alle implementierten Schnittstellen:
Serializable
Point geometry.
- Autor:
- Sebastian Baumhekel
- Siehe auch:
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final intThe OGIS geometry type number for points.Von Klasse geerbte Felder io.github.sebasbaumh.postgis.Geometry
UNKNOWN_SRID -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanDo some internal consistency checks on the geometry.booleancoordsAreEqual(Point other) copy()Creates a copy of thisPoint.doubleCalculates the distance to the givenPoint.booleanjava.lang.Object equals implementationGets the coordinates of thisGeometry.doublegetM()Gets the measurement.intGets the number of coordinates of thisGeometry.doublegetX()Gets the X-coordinate.doublegetY()Gets the Y-coordinate.doublegetZ()Gets the Z-coordinate.inthashCode()booleanReturns whether we have a measure (4th dimension)booleanis3d()Checks if thisGeometryis 3d.booleanisEmpty()Ist thisGeometryempty, so does it contain no coordinates or other geometries?voidsetM(double m) Sets the measurement.voidsetX(double x) Sets the X-coordinate.voidsetY(double y) Sets the Y-coordinate.voidsetZ(double z) Sets the Z-coordinate.to2d()Gets thisPointas a 2d object.toString()
-
Felddetails
-
TYPE
public static final int TYPEThe OGIS geometry type number for points.- Siehe auch:
-
-
Konstruktordetails
-
Point
public Point()Constructs an empty instance. -
Point
public Point(double x, double y) Constructs a new Point- Parameter:
x- the longitude / x ordinatey- the latitude / y ordinate
-
Point
public Point(double x, double y, double z) Constructs a new Point- Parameter:
x- the longitude / x ordinatey- the latitude / y ordinatez- the radius / height / elevation / z ordinate (can beDouble.NaNfor no coordinate)
-
Point
public Point(double x, double y, double z, double m) Constructs a new Point- Parameter:
x- the longitude / x ordinatey- the latitude / y ordinatez- the radius / height / elevation / z ordinate (can beDouble.NaNfor no coordinate)m- measure (4th dimension)
-
-
Methodendetails
-
checkConsistency
public boolean checkConsistency()Beschreibung aus Klasse kopiert:GeometryDo some internal consistency checks on the geometry. Currently, all Geometries must have a valid dimension (2 or 3) and a valid type. Composed geometries must have all equal SRID, dimensionality and measures, as well as that they do not contain NULL or inconsistent subgeometries. BinaryParser and WKTParser should only generate consistent geometries. BinaryWriter may produce invalid results on inconsistent geometries.- Setzt außer Kraft:
checkConsistencyin KlasseGeometry- Gibt zurück:
- true if all checks are passed.
-
coordsAreEqual
- Parameter:
other-Point- Gibt zurück:
- true on success, else false
-
copy
Creates a copy of thisPoint.- Gibt zurück:
Point
-
distance
Calculates the distance to the givenPoint.- Parameter:
p-Point- Gibt zurück:
- distance
-
equals
Beschreibung aus Klasse kopiert:Geometryjava.lang.Object equals implementation -
getCoordinates
Beschreibung aus Klasse kopiert:GeometryGets the coordinates of thisGeometry.- Angegeben von:
getCoordinatesin KlasseGeometry- Gibt zurück:
- coordinates
-
getM
public double getM()Gets the measurement.- Gibt zurück:
- measurement on success, else
Double.NaN
-
getNumberOfCoordinates
public int getNumberOfCoordinates()Beschreibung aus Klasse kopiert:GeometryGets the number of coordinates of thisGeometry.- Angegeben von:
getNumberOfCoordinatesin KlasseGeometry- Gibt zurück:
- number of coordinates
-
getX
public double getX()Gets the X-coordinate.- Gibt zurück:
- X-coordinate on success, else
Double.NaN
-
getY
public double getY()Gets the Y-coordinate.- Gibt zurück:
- Y-coordinate on success, else
Double.NaN
-
getZ
public double getZ()Gets the Z-coordinate.- Gibt zurück:
- Z-coordinate on success, else
Double.NaN
-
hashCode
public int hashCode() -
hasMeasure
public boolean hasMeasure()Beschreibung aus Klasse kopiert:GeometryReturns whether we have a measure (4th dimension)- Angegeben von:
hasMeasurein KlasseGeometry- Gibt zurück:
- true if the geometry has a measure, false otherwise
-
is3d
public boolean is3d()Beschreibung aus Klasse kopiert:GeometryChecks if thisGeometryis 3d. -
isEmpty
public boolean isEmpty()Beschreibung aus Klasse kopiert:GeometryIst thisGeometryempty, so does it contain no coordinates or other geometries? -
setM
public void setM(double m) Sets the measurement.- Parameter:
m- measurement
-
setX
public void setX(double x) Sets the X-coordinate.- Parameter:
x- X-coordinate
-
setY
public void setY(double y) Sets the Y-coordinate.- Parameter:
y- Y-coordinate
-
setZ
public void setZ(double z) Sets the Z-coordinate.- Parameter:
z- Z-coordinate
-
to2d
Gets thisPointas a 2d object.- Gibt zurück:
Point
-
toString
-