Package org.h2.util.geometry
Class GeometryUtils
java.lang.Object
org.h2.util.geometry.GeometryUtils
Utilities for GEOMETRY data type.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classConverter output target that determines minimal dimension system for a geometry.static final classConverter output target that calculates an envelope.static classConverter output target. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intCode of 2D (XY) dimension system.static final intCode of M (XYM) dimension system.static final intCode of Z (XYZ) dimension system.static final intCode of ZM (XYZM) dimension system.static final intGEOMETRYCOLLECTION geometry type.static final intLINESTRING geometry type.static final intNumber of M coordinate.static final intMaximum X coordinate index.static final intMaximum Y coordinate index.static final intMinimum X coordinate index.static final intMinimum Y coordinate index.static final intMULTILINESTRING geometry type.static final intMULTIPOINT geometry type.static final intMULTIPOLYGON geometry type.static final intPOINT geometry type.static final intPOLYGON geometry type.static final intNumber of X coordinate.static final intNumber of Y coordinate.static final intNumber of Z coordinate. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static double[]union(double[] envelope1, double[] envelope2) Returns union of two envelopes.
-
Field Details
-
POINT
public static final int POINTPOINT geometry type.- See Also:
-
LINE_STRING
public static final int LINE_STRINGLINESTRING geometry type.- See Also:
-
POLYGON
public static final int POLYGONPOLYGON geometry type.- See Also:
-
MULTI_POINT
public static final int MULTI_POINTMULTIPOINT geometry type.- See Also:
-
MULTI_LINE_STRING
public static final int MULTI_LINE_STRINGMULTILINESTRING geometry type.- See Also:
-
MULTI_POLYGON
public static final int MULTI_POLYGONMULTIPOLYGON geometry type.- See Also:
-
GEOMETRY_COLLECTION
public static final int GEOMETRY_COLLECTIONGEOMETRYCOLLECTION geometry type.- See Also:
-
X
public static final int XNumber of X coordinate.- See Also:
-
Y
public static final int YNumber of Y coordinate.- See Also:
-
Z
public static final int ZNumber of Z coordinate.- See Also:
-
M
public static final int MNumber of M coordinate.- See Also:
-
DIMENSION_SYSTEM_XY
public static final int DIMENSION_SYSTEM_XYCode of 2D (XY) dimension system.- See Also:
-
DIMENSION_SYSTEM_XYZ
public static final int DIMENSION_SYSTEM_XYZCode of Z (XYZ) dimension system. Can also be used in bit masks to determine presence of dimension Z.- See Also:
-
DIMENSION_SYSTEM_XYM
public static final int DIMENSION_SYSTEM_XYMCode of M (XYM) dimension system. Can also be used in bit masks to determine presence of dimension M.- See Also:
-
DIMENSION_SYSTEM_XYZM
public static final int DIMENSION_SYSTEM_XYZMCode of ZM (XYZM) dimension system. Can be also combined fromDIMENSION_SYSTEM_XYZandDIMENSION_SYSTEM_XYMusing bitwise OR.- See Also:
-
MIN_X
public static final int MIN_XMinimum X coordinate index.- See Also:
-
MAX_X
public static final int MAX_XMaximum X coordinate index.- See Also:
-
MIN_Y
public static final int MIN_YMinimum Y coordinate index.- See Also:
-
MAX_Y
public static final int MAX_YMaximum Y coordinate index.- See Also:
-
-
Method Details
-
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
-