use of com.vividsolutions.jts.geom.Envelope 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());
}
use of com.vividsolutions.jts.geom.Envelope in project ddf by codice.
the class WfsFilterDelegate method createEnvelopeFromWkt.
private Envelope createEnvelopeFromWkt(String wkt) {
Envelope envelope = null;
try {
Geometry geo = getGeometryFromWkt(wkt);
envelope = geo.getEnvelopeInternal();
} catch (ParseException e) {
throw new IllegalArgumentException("Unable to parse WKT String", e);
}
return envelope;
}
use of com.vividsolutions.jts.geom.Envelope in project ddf by codice.
the class WfsFilterDelegate method createCoordinatesTypeFromWkt.
private JAXBElement<CoordinatesType> createCoordinatesTypeFromWkt(String wkt) {
Envelope envelope = createEnvelopeFromWkt(wkt);
String coords = buildCoordinateString(envelope);
CoordinatesType coordinatesType = new CoordinatesType();
coordinatesType.setValue(coords);
return gmlObjectFactory.createCoordinates(coordinatesType);
}
use of com.vividsolutions.jts.geom.Envelope in project GeoGig by boundlessgeo.
the class GeogigSimpleFeature method getAttribute.
@Override
public Object getAttribute(int index) throws IndexOutOfBoundsException {
if (node != null && index == defaultGeomIndex && defaultGeomIsPoint && (resolvedValues == null || resolvedValues instanceof ImmutableList)) {
Envelope e = new Envelope();
node.expand(e);
if (e.isNull()) {
return null;
}
return DEFAULT_GEOM_FACTORY.createPoint(new Coordinate(e.getMinX(), e.getMinY()));
}
return getValues().get(index).orNull();
}
use of com.vividsolutions.jts.geom.Envelope in project GeoGig by boundlessgeo.
the class DiffTreeTest method feature.
private Node feature(int i, ObjectId oid) {
String name = String.valueOf(i);
TYPE type = TYPE.FEATURE;
Envelope bounds = new Envelope(i, i, i, i);
return Node.create(name, oid, metadataId, type, bounds);
}
Aggregations