Package org.h2.util.geometry
Class JTSUtils
- java.lang.Object
-
- org.h2.util.geometry.JTSUtils
-
public final class JTSUtils extends java.lang.ObjectUtilities for Geometry data type from JTS library.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJTSUtils.GeometryTargetConverter output target that creates a JTS Geometry.
-
Constructor Summary
Constructors Modifier Constructor Description privateJTSUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidaddCoordinate(org.locationtech.jts.geom.CoordinateSequence sequence, GeometryUtils.Target target, int index, int total)private static voidaddCoordinate(org.locationtech.jts.geom.CoordinateSequence sequence, GeometryUtils.Target target, int index, int total, double x, double y)private static voidaddRing(org.locationtech.jts.geom.CoordinateSequence sequence, GeometryUtils.Target target, int size)static org.locationtech.jts.geom.Geometryewkb2geometry(byte[] ewkb)Converts EWKB to a JTS geometry object.static org.locationtech.jts.geom.Geometryewkb2geometry(byte[] ewkb, int dimensionSystem)Converts EWKB to a JTS geometry object.static byte[]geometry2ewkb(org.locationtech.jts.geom.Geometry geometry)Converts Geometry to EWKB.static byte[]geometry2ewkb(org.locationtech.jts.geom.Geometry geometry, int dimensionSystem)Converts Geometry to EWKB.static intgetDimensionSystem(org.locationtech.jts.geom.Geometry geometry)Determines a dimension system of a JTS Geometry object.private static intgetDimensionSystem1(org.locationtech.jts.geom.Geometry geometry)private static intgetDimensionSystemFromCoordinate(org.locationtech.jts.geom.CoordinateSequence sequence, int index)private static intgetDimensionSystemFromSequence(org.locationtech.jts.geom.CoordinateSequence sequence)static voidparseGeometry(org.locationtech.jts.geom.Geometry geometry, GeometryUtils.Target target)Parses a JTS Geometry object.private static voidparseGeometry(org.locationtech.jts.geom.Geometry geometry, GeometryUtils.Target target, int parentType)Parses a JTS Geometry object.
-
-
-
Method Detail
-
ewkb2geometry
public static org.locationtech.jts.geom.Geometry ewkb2geometry(byte[] ewkb)
Converts EWKB to a JTS geometry object.- Parameters:
ewkb- source EWKB- Returns:
- JTS geometry object
-
ewkb2geometry
public static org.locationtech.jts.geom.Geometry ewkb2geometry(byte[] ewkb, int dimensionSystem)Converts EWKB to a JTS geometry object.- Parameters:
ewkb- source EWKBdimensionSystem- dimension system- Returns:
- JTS geometry object
-
geometry2ewkb
public static byte[] geometry2ewkb(org.locationtech.jts.geom.Geometry geometry)
Converts Geometry to EWKB.- Parameters:
geometry- source geometry- Returns:
- EWKB representation
-
geometry2ewkb
public static byte[] geometry2ewkb(org.locationtech.jts.geom.Geometry geometry, int dimensionSystem)Converts Geometry to EWKB.- Parameters:
geometry- source geometrydimensionSystem- dimension system- Returns:
- EWKB representation
-
parseGeometry
public static void parseGeometry(org.locationtech.jts.geom.Geometry geometry, GeometryUtils.Target target)Parses a JTS Geometry object.- Parameters:
geometry- geometry to parsetarget- output target
-
parseGeometry
private static void parseGeometry(org.locationtech.jts.geom.Geometry geometry, GeometryUtils.Target target, int parentType)Parses a JTS Geometry object.- Parameters:
geometry- geometry to parsetarget- output targetparentType- type of parent geometry collection, or 0 for the root geometry
-
addRing
private static void addRing(org.locationtech.jts.geom.CoordinateSequence sequence, GeometryUtils.Target target, int size)
-
addCoordinate
private static void addCoordinate(org.locationtech.jts.geom.CoordinateSequence sequence, GeometryUtils.Target target, int index, int total)
-
addCoordinate
private static void addCoordinate(org.locationtech.jts.geom.CoordinateSequence sequence, GeometryUtils.Target target, int index, int total, double x, double y)
-
getDimensionSystem
public static int getDimensionSystem(org.locationtech.jts.geom.Geometry geometry)
Determines a dimension system of a JTS Geometry object.- Parameters:
geometry- geometry to parse- Returns:
- the dimension system
-
getDimensionSystem1
private static int getDimensionSystem1(org.locationtech.jts.geom.Geometry geometry)
-
getDimensionSystemFromSequence
private static int getDimensionSystemFromSequence(org.locationtech.jts.geom.CoordinateSequence sequence)
-
getDimensionSystemFromCoordinate
private static int getDimensionSystemFromCoordinate(org.locationtech.jts.geom.CoordinateSequence sequence, int index)
-
-