Top Description Fields Constructors Methods
org.h2.value

public final Class ValueGeometry

extends ValueBytesBase
Class Inheritance
Static Imports
org.h2.util.Bits.INT_VH_BE, org.h2.util.geometry.EWKBUtils.EWKB_SRID

Implementation of the GEOMETRY data type.
Authors
Thomas Mueller, Noel Grandin, Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888

Field Summary

Modifier and TypeField and Description
private double[]
envelope

The envelope of the value.

private Object
geometry

The value.

private final int
srid

Spatial reference system identifier.

private final int
typeAndDimensionSystem

Geometry type and dimension system in OGC geometry code format (type + dimensionSystem * 1000).

private static final double[]
Inherited from org.h2.value.ValueBytesBase:
hashvalue

Constructor Summary

AccessConstructor and Description
private
ValueGeometry(byte[]
the EWKB bytes
bytes
,
double[]
the envelope
envelope
)

Create a new geometry object.

Method Summary

Modifier and TypeMethod and Description
public static Value

Returns:

the value
fromEnvelope
(double[]
envelope. May not be modified.
envelope
)

Creates a geometry value for the given envelope.

public static ValueGeometry

Returns:

the value
get
(String
the WKT or EWKT representation of the geometry
s
)

Get or create a geometry value for the given geometry.

public static ValueGeometry

Returns:

the value
get
(byte[]
the WKB representation of the geometry. May not be modified.
bytes
)

Get or create a geometry value for the given internal EWKB representation.

public int

Returns:

dimension system
getDimensionSystem
()

Return a minimal dimension system that can be used for this geometry.

public double[]

Returns:

envelope of this geometry
getEnvelopeNoCopy
()

Return an envelope of this geometry.

public Value

Returns:

the union of this geometry envelope and another geometry envelope
getEnvelopeUnion
(ValueGeometry
the other geometry
r
)

Get the union.

public static ValueGeometry

Returns:

the value
getFromEWKB
(byte[]
the WKB representation of the geometry
bytes
)

Get or create a geometry value for the given EWKB value.

public static ValueGeometry

Returns:

the value
getFromGeometry
(Object
the geometry object (of type org.locationtech.jts.geom.Geometry)
o
)

Get or create a geometry value for the given geometry.

public org.locationtech.jts.geom.Geometry

Returns:

a copy of the geometry object
getGeometry
()

Get a copy of geometry object.

public int

Returns:

geometry type and dimension system
getGeometryType
()

Returns geometry type.

public int
getMemory()

Overrides org.h2.value.ValueBytesBase.getMemory.

Get the memory used by this object.

public StringBuilder
getSQL(StringBuilder
string builder
builder
,
int
formatting flags
sqlFlags
)

Overrides org.h2.value.ValueBytesBase.getSQL.

Implements org.h2.util.HasSQL.getSQL.

Appends the SQL statement of this object to the specified builder.

public int

Returns:

spatial reference system identifier
getSRID
()

Return a spatial reference system identifier.

public String
getString()

Implements abstract org.h2.value.Value.getString.

Get the value as a string.

public TypeInfo
getType()

Implements abstract org.h2.value.Value.getType.

Implements org.h2.value.Typed.getType.

Returns the data type.

public int

Returns:

geometry type and dimension system
getTypeAndDimensionSystem
()

Returns geometry type and dimension system in OGC geometry code format (type + dimensionSystem * 1000).

public int
getValueType()

Implements abstract org.h2.value.Value.getValueType.

Get the value type.

public boolean

Returns:

true if the two overlap
intersectsBoundingBox
(ValueGeometry
the other geometry
r
)

Test if this geometry envelope intersects with the other geometry envelope.

Inherited from org.h2.value.ValueBytesBase:
compareTypeSafeequalsgetBytesgetBytesNoCopyhashCode

Field Detail

envelopeback to summary
private double[] envelope

The envelope of the value. Calculated only on request.

geometryback to summary
private Object geometry

The value. Converted from WKB only on request as conversion from/to WKB cost a significant amount of CPU cycles.

sridback to summary
private final int srid

Spatial reference system identifier.

typeAndDimensionSystemback to summary
private final int typeAndDimensionSystem

Geometry type and dimension system in OGC geometry code format (type + dimensionSystem * 1000).

UNKNOWN_ENVELOPEback to summary
private static final double[] UNKNOWN_ENVELOPE

Constructor Detail

ValueGeometryback to summary
private ValueGeometry(byte[] bytes, double[] envelope)

Create a new geometry object.

Parameters
bytes:byte[]

the EWKB bytes

envelope:double[]

the envelope

Method Detail

fromEnvelopeback to summary
public static Value fromEnvelope(double[] envelope)

Creates a geometry value for the given envelope.

Parameters
envelope:double[]

envelope. May not be modified.

Returns:Value

the value

getback to summary
public static ValueGeometry get(String s)

Get or create a geometry value for the given geometry.

Parameters
s:String

the WKT or EWKT representation of the geometry

Returns:ValueGeometry

the value

getback to summary
public static ValueGeometry get(byte[] bytes)

Get or create a geometry value for the given internal EWKB representation.

Parameters
bytes:byte[]

the WKB representation of the geometry. May not be modified.

Returns:ValueGeometry

the value

getDimensionSystemback to summary
public int getDimensionSystem()

Return a minimal dimension system that can be used for this geometry.

Returns:int

dimension system

getEnvelopeNoCopyback to summary
public double[] getEnvelopeNoCopy()

Return an envelope of this geometry. Do not modify the returned value.

Returns:double[]

envelope of this geometry

getEnvelopeUnionback to summary
public Value getEnvelopeUnion(ValueGeometry r)

Get the union.

Parameters
r:ValueGeometry

the other geometry

Returns:Value

the union of this geometry envelope and another geometry envelope

getFromEWKBback to summary
public static ValueGeometry getFromEWKB(byte[] bytes)

Get or create a geometry value for the given EWKB value.

Parameters
bytes:byte[]

the WKB representation of the geometry

Returns:ValueGeometry

the value

getFromGeometryback to summary
public static ValueGeometry getFromGeometry(Object o)

Get or create a geometry value for the given geometry.

Parameters
o:Object

the geometry object (of type org.locationtech.jts.geom.Geometry)

Returns:ValueGeometry

the value

getGeometryback to summary
public org.locationtech.jts.geom.Geometry getGeometry()

Get a copy of geometry object. Geometry object is mutable. The returned object is therefore copied before returning.

Returns:org.locationtech.jts.geom.Geometry

a copy of the geometry object

getGeometryTypeback to summary
public int getGeometryType()

Returns geometry type.

Returns:int

geometry type and dimension system

getMemoryback to summary
public int getMemory()

Overrides org.h2.value.ValueBytesBase.getMemory.

Doc from org.h2.value.Value.getMemory.

Get the memory used by this object.

Returns:int

the memory used in bytes

Annotations
@Override
getSQLback to summary
public StringBuilder getSQL(StringBuilder builder, int sqlFlags)

Overrides org.h2.value.ValueBytesBase.getSQL.

Implements org.h2.util.HasSQL.getSQL.

Doc from org.h2.util.HasSQL.getSQL.

Appends the SQL statement of this object to the specified builder.

Parameters
builder:StringBuilder

string builder

sqlFlags:int

formatting flags

Returns:StringBuilder

the specified string builder

Annotations
@Override
getSRIDback to summary
public int getSRID()

Return a spatial reference system identifier.

Returns:int

spatial reference system identifier

getStringback to summary
public String getString()

Implements abstract org.h2.value.Value.getString.

Doc from org.h2.value.Value.getString.

Get the value as a string.

Returns:String

the string

Annotations
@Override
getTypeback to summary
public TypeInfo getType()

Implements abstract org.h2.value.Value.getType.

Implements org.h2.value.Typed.getType.

Doc from org.h2.value.Typed.getType.

Returns the data type.

Returns:TypeInfo

the data type

Annotations
@Override
getTypeAndDimensionSystemback to summary
public int getTypeAndDimensionSystem()

Returns geometry type and dimension system in OGC geometry code format (type + dimensionSystem * 1000).

Returns:int

geometry type and dimension system

getValueTypeback to summary
public int getValueType()

Implements abstract org.h2.value.Value.getValueType.

Doc from org.h2.value.Value.getValueType.

Get the value type.

Returns:int

the value type

Annotations
@Override
intersectsBoundingBoxback to summary
public boolean intersectsBoundingBox(ValueGeometry r)

Test if this geometry envelope intersects with the other geometry envelope.

Parameters
r:ValueGeometry

the other geometry

Returns:boolean

true if the two overlap