Search in sources :

Example 1 with SpatialKey

use of org.h2.mvstore.rtree.SpatialKey in project ignite by apache.

the class GridH2SpatialIndex method getEnvelope.

/**
     * @param row Row.
     * @param rowId Row id.
     * @return Envelope.
     */
private SpatialKey getEnvelope(SearchRow row, long rowId) {
    Value v = row.getValue(columnIds[0]);
    Geometry g = ((ValueGeometry) v.convertTo(Value.GEOMETRY)).getGeometry();
    Envelope env = g.getEnvelopeInternal();
    return new SpatialKey(rowId, (float) env.getMinX(), (float) env.getMaxX(), (float) env.getMinY(), (float) env.getMaxY());
}
Also used : Geometry(com.vividsolutions.jts.geom.Geometry) ValueGeometry(org.h2.value.ValueGeometry) SpatialKey(org.h2.mvstore.rtree.SpatialKey) ValueGeometry(org.h2.value.ValueGeometry) Value(org.h2.value.Value) Envelope(com.vividsolutions.jts.geom.Envelope)

Aggregations

Envelope (com.vividsolutions.jts.geom.Envelope)1 Geometry (com.vividsolutions.jts.geom.Geometry)1 SpatialKey (org.h2.mvstore.rtree.SpatialKey)1 Value (org.h2.value.Value)1 ValueGeometry (org.h2.value.ValueGeometry)1