Package org.h2.util.geometry
Class GeometryUtils
- java.lang.Object
-
- org.h2.util.geometry.GeometryUtils
-
public final class GeometryUtils extends java.lang.ObjectUtilities for GEOMETRY data type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGeometryUtils.DimensionSystemTargetConverter output target that determines minimal dimension system for a geometry.static classGeometryUtils.EnvelopeTargetConverter output target that calculates an envelope.static classGeometryUtils.TargetConverter output target.
-
Field Summary
Fields Modifier and Type Field Description static intDIMENSION_SYSTEM_XYCode of 2D (XY) dimension system.static intDIMENSION_SYSTEM_XYMCode of M (XYM) dimension system.static intDIMENSION_SYSTEM_XYZCode of Z (XYZ) dimension system.static intDIMENSION_SYSTEM_XYZMCode of ZM (XYZM) dimension system.static intGEOMETRY_COLLECTIONGEOMETRYCOLLECTION geometry type.static intLINE_STRINGLINESTRING geometry type.static intMNumber of M coordinate.static intMAX_XMaximum X coordinate index.static intMAX_YMaximum Y coordinate index.static intMIN_XMinimum X coordinate index.static intMIN_YMinimum Y coordinate index.static intMULTI_LINE_STRINGMULTILINESTRING geometry type.static intMULTI_POINTMULTIPOINT geometry type.static intMULTI_POLYGONMULTIPOLYGON geometry type.static intPOINTPOINT geometry type.static intPOLYGONPOLYGON geometry type.static intXNumber of X coordinate.static intYNumber of Y coordinate.static intZNumber of Z coordinate.
-
Constructor Summary
Constructors Modifier Constructor Description privateGeometryUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static doublecheckFinite(double d)Throw exception if param is not finite value (ie.static double[]getEnvelope(byte[] ewkb)Calculates an envelope of a specified geometry.static booleanintersects(double[] envelope1, double[] envelope2)Checks whether two envelopes intersect with each other.(package private) static doubletoCanonicalDouble(double d)Normalizes all NaNs into single type on NaN and negative zero to positive zero.static double[]union(double[] envelope1, double[] envelope2)Returns union of two envelopes.
-
-
-
Field Detail
-
POINT
public static final int POINT
POINT geometry type.- See Also:
- Constant Field Values
-
LINE_STRING
public static final int LINE_STRING
LINESTRING geometry type.- See Also:
- Constant Field Values
-
POLYGON
public static final int POLYGON
POLYGON geometry type.- See Also:
- Constant Field Values
-
MULTI_POINT
public static final int MULTI_POINT
MULTIPOINT geometry type.- See Also:
- Constant Field Values
-
MULTI_LINE_STRING
public static final int MULTI_LINE_STRING
MULTILINESTRING geometry type.- See Also:
- Constant Field Values
-
MULTI_POLYGON
public static final int MULTI_POLYGON
MULTIPOLYGON geometry type.- See Also:
- Constant Field Values
-
GEOMETRY_COLLECTION
public static final int GEOMETRY_COLLECTION
GEOMETRYCOLLECTION geometry type.- See Also:
- Constant Field Values
-
X
public static final int X
Number of X coordinate.- See Also:
- Constant Field Values
-
Y
public static final int Y
Number of Y coordinate.- See Also:
- Constant Field Values
-
Z
public static final int Z
Number of Z coordinate.- See Also:
- Constant Field Values
-
M
public static final int M
Number of M coordinate.- See Also:
- Constant Field Values
-
DIMENSION_SYSTEM_XY
public static final int DIMENSION_SYSTEM_XY
Code of 2D (XY) dimension system.- See Also:
- Constant Field Values
-
DIMENSION_SYSTEM_XYZ
public static final int DIMENSION_SYSTEM_XYZ
Code of Z (XYZ) dimension system. Can also be used in bit masks to determine presence of dimension Z.- See Also:
- Constant Field Values
-
DIMENSION_SYSTEM_XYM
public static final int DIMENSION_SYSTEM_XYM
Code of M (XYM) dimension system. Can also be used in bit masks to determine presence of dimension M.- See Also:
- Constant Field Values
-
DIMENSION_SYSTEM_XYZM
public static final int DIMENSION_SYSTEM_XYZM
Code of ZM (XYZM) dimension system. Can be also combined fromDIMENSION_SYSTEM_XYZandDIMENSION_SYSTEM_XYMusing bitwise OR.- See Also:
- Constant Field Values
-
MIN_X
public static final int MIN_X
Minimum X coordinate index.- See Also:
- Constant Field Values
-
MAX_X
public static final int MAX_X
Maximum X coordinate index.- See Also:
- Constant Field Values
-
MIN_Y
public static final int MIN_Y
Minimum Y coordinate index.- See Also:
- Constant Field Values
-
MAX_Y
public static final int MAX_Y
Maximum Y coordinate index.- See Also:
- Constant Field Values
-
-
Method Detail
-
getEnvelope
public static double[] getEnvelope(byte[] ewkb)
Calculates an envelope of a specified geometry.- Parameters:
ewkb- EWKB of a geometry- Returns:
- envelope, or null
-
intersects
public static boolean intersects(double[] envelope1, double[] envelope2)Checks whether two envelopes intersect with each other.- Parameters:
envelope1- first envelope, or nullenvelope2- second envelope, or null- Returns:
- whether the specified envelopes intersects
-
union
public static double[] union(double[] envelope1, double[] envelope2)Returns union of two envelopes. This method does not modify the specified envelopes, but may return one of them as a result.- Parameters:
envelope1- first envelope, or nullenvelope2- second envelope, or null- Returns:
- union of two envelopes
-
toCanonicalDouble
static double toCanonicalDouble(double d)
Normalizes all NaNs into single type on NaN and negative zero to positive zero.- Parameters:
d- double value- Returns:
- normalized value
-
checkFinite
static double checkFinite(double d)
Throw exception if param is not finite value (ie. NaN/inf/etc)- Parameters:
d- a double value- Returns:
- the same double value
-
-