Package net.postgis.jdbc.geometry
Class Point
java.lang.Object
net.postgis.jdbc.geometry.Geometry
net.postgis.jdbc.geometry.Point
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleandoubleThe measure of the point.doubleThe X coordinate of the point.doubleThe Y coordinate of the point.doubleThe Z coordinate of the point.Fields inherited from class net.postgis.jdbc.geometry.Geometry
ALLTYPES, dimension, GEOMETRYCOLLECTION, haveMeasure, LINEARRING, LINESTRING, MULTILINESTRING, MULTIPOINT, MULTIPOLYGON, POINT, POLYGON, srid, type, UNKNOWN_SRID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDo some internal consistency checks on the geometry.doublestatic booleandouble_equals(double a, double b) final booleanprotected booleanequalsintern(Geometry otherg) Whether test coordinates for geometry - subclass specific code Implementors can assume that dimensin, type, srid and haveMeasure are equal, other != null and other is the same subclass.Optimized versions for this special caseOptimized versions for this special casedoublegetM()getPoint(int index) Get the nth Point of the geometrydoublegetX()doublegetY()doublegetZ()inthashCode()java.lang.Object hashCode implementationstatic inthashCode(double value) voidinnerWKT(StringBuffer sb) Render the "inner" part of the WKT (inside the brackets) into the StringBuffer.intReturn the number of Points of the geometryvoidsetM(double m) voidsetX(double x) voidsetX(int x) voidsetY(double y) voidsetY(int y) voidsetZ(double z) voidsetZ(int z) Methods inherited from class net.postgis.jdbc.geometry.Geometry
equals, equals, getDimension, getSrid, getType, getTypeString, getTypeString, getValue, initSRID, isMeasured, mediumWKT, outerWKT, outerWKT, parseSRID, setSrid, toString
-
Field Details
-
CUTINTS
public static final boolean CUTINTS- See Also:
-
x
public double xThe X coordinate of the point. In most long/lat systems, this is the longitude. -
y
public double yThe Y coordinate of the point. In most long/lat systems, this is the latitude. -
z
public double zThe Z coordinate of the point. In most long/lat systems, this is a radius from the center of the earth, or the height / elevation over the ground. -
m
public double mThe measure of the point.
-
-
Constructor Details
-
Point
public Point() -
Point
public Point(double x, double y, double z) Constructs a new Point- Parameters:
x- the longitude / x ordinatey- the latitude / y ordinatez- the radius / height / elevation / z ordinate
-
Point
public Point(double x, double y) Constructs a new Point- Parameters:
x- the longitude / x ordinatey- the latitude / y ordinate
-
Point
Construct a Point from EWKT. (3D and measures are legal, but SRID is not allowed).- Parameters:
value- String representation of the geometry.- Throws:
SQLException- when a SQLException occurs
-
Point
Construct a Point- Parameters:
value- The text representation of this pointhaveM- Hint whether we have a measure. This is used by other geometries parsing inner points where we only get "1 2 3 4" like strings without the "POINT(" and ")" stuff. If there acutally is a POINTM prefix, this overrides the given value. However, POINT does not set it to false, as they can be contained in measured collections, as in "GEOMETRYCOLLECTIONM(POINT(0 0 0))".- Throws:
SQLException- when a SQLException occurs
-
-
Method Details
-
hashCode
public int hashCode()Description copied from class:Geometryjava.lang.Object hashCode implementation -
hashCode
public static int hashCode(double value) -
equalsintern
Description copied from class:GeometryWhether test coordinates for geometry - subclass specific code Implementors can assume that dimensin, type, srid and haveMeasure are equal, other != null and other is the same subclass.- Specified by:
equalsinternin classGeometry- Parameters:
otherg- geometry to compare- Returns:
- true if equal, false otherwise
-
double_equals
public static boolean double_equals(double a, double b) -
equals
-
getPoint
Description copied from class:GeometryGet the nth Point of the geometry -
getFirstPoint
Optimized versions for this special case- Specified by:
getFirstPointin classGeometry- Returns:
- the initial Point in this geometry
-
getLastPoint
Optimized versions for this special case- Specified by:
getLastPointin classGeometry- Returns:
- the final Point in this geometry
-
numPoints
public int numPoints()Description copied from class:GeometryReturn the number of Points of the geometry -
innerWKT
Description copied from class:GeometryRender the "inner" part of the WKT (inside the brackets) into the StringBuffer. -
getX
public double getX() -
getY
public double getY() -
getZ
public double getZ() -
getM
public double getM() -
setX
public void setX(double x) -
setY
public void setY(double y) -
setZ
public void setZ(double z) -
setM
public void setM(double m) -
setX
public void setX(int x) -
setY
public void setY(int y) -
setZ
public void setZ(int z) -
distance
-
checkConsistency
public boolean checkConsistency()Description copied from class:GeometryDo some internal consistency checks on the geometry. Currently, all Geometries must have a valid dimension (2 or 3) and a valid type. 2-dimensional Points must have Z=0.0, as well as non-measured Points must have m=0.0. 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.- Overrides:
checkConsistencyin classGeometry- Returns:
- true if all checks are passed.
-