use of org.locationtech.geowave.service.grpc.protobuf.SpatialQueryParametersProtos in project geowave by locationtech.
the class GeoWaveGrpcTestClient method spatialQuery.
public ArrayList<FeatureProtos> spatialQuery() throws UnsupportedEncodingException {
LOGGER.info("Performing Spatial Query...");
final VectorStoreParametersProtos baseParams = VectorStoreParametersProtos.newBuilder().setStoreName(GeoWaveGrpcTestUtils.storeName).setTypeName(GeoWaveGrpcTestUtils.typeName).setIndexName(GeoWaveGrpcTestUtils.indexName).build();
final SpatialQueryParametersProtos request = SpatialQueryParametersProtos.newBuilder().setBaseParams(baseParams).setGeometry(copyFrom(GeoWaveGrpcTestUtils.wkbSpatialQuery)).build();
Iterator<FeatureProtos> features;
final ArrayList<FeatureProtos> feature_list = new ArrayList<>();
features = vectorBlockingStub.spatialQuery(request);
// iterate over features
for (int i = 1; features.hasNext(); i++) {
final FeatureProtos feature = features.next();
feature_list.add(feature);
}
return feature_list;
}
use of org.locationtech.geowave.service.grpc.protobuf.SpatialQueryParametersProtos in project geowave by locationtech.
the class GeoWaveGrpcTestClient method spatialTemporalQuery.
public ArrayList<FeatureProtos> spatialTemporalQuery() throws ParseException {
LOGGER.info("Performing Spatial Temporal Query...");
final VectorStoreParametersProtos baseParams = VectorStoreParametersProtos.newBuilder().setStoreName(GeoWaveGrpcTestUtils.storeName).build();
final TimeZone tz = TimeZone.getTimeZone("UTC");
// Quoted "Z" to indicate
final DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'");
// UTC,
// no timezone offset
df.setTimeZone(tz);
final SpatialQueryParametersProtos spatialQuery = SpatialQueryParametersProtos.newBuilder().setBaseParams(baseParams).setGeometry(copyFrom(GeoWaveGrpcTestUtils.wkbSpatialQuery)).build();
final TemporalConstraintsProtos t = TemporalConstraintsProtos.newBuilder().setStartTime(Timestamps.fromMillis(df.parse(GeoWaveGrpcTestUtils.temporalQueryStartTime).getTime())).setEndTime(Timestamps.fromMillis(df.parse(GeoWaveGrpcTestUtils.temporalQueryEndTime).getTime())).build();
final SpatialTemporalQueryParametersProtos request = SpatialTemporalQueryParametersProtos.newBuilder().setSpatialParams(spatialQuery).addTemporalConstraints(0, t).setCompareOperation("CONTAINS").build();
Iterator<FeatureProtos> features;
final ArrayList<FeatureProtos> feature_list = new ArrayList<>();
features = vectorBlockingStub.spatialTemporalQuery(request);
// iterate over features
while (features.hasNext()) {
final FeatureProtos feature = features.next();
feature_list.add(feature);
}
return feature_list;
}
Aggregations