org.geotools.data.Query Java Examples
The following examples show how to use
org.geotools.data.Query.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DecimationProcess.java From geowave with Apache License 2.0 | 6 votes |
public Query invertQuery( @DescribeParameter( name = "outputBBOX", description = "Georeferenced bounding box of the output") final ReferencedEnvelope argOutputEnv, @DescribeParameter( name = "outputWidth", description = "Width of the output raster") final Integer argOutputWidth, @DescribeParameter( name = "outputHeight", description = "Height of the output raster") final Integer argOutputHeight, @DescribeParameter( name = "pixelSize", description = "The pixel size to decimate by") final Double pixelSize, final Query targetQuery, final GridGeometry targetGridGeometry) throws ProcessException { // add to the query hints targetQuery.getHints().put(OUTPUT_WIDTH, argOutputWidth); targetQuery.getHints().put(OUTPUT_HEIGHT, argOutputHeight); targetQuery.getHints().put(OUTPUT_BBOX, argOutputEnv); if (pixelSize != null) { targetQuery.getHints().put(PIXEL_SIZE, pixelSize); } return targetQuery; }
Example #2
Source File: GeoWaveFeatureSourceTest.java From geowave with Apache License 2.0 | 6 votes |
public void testPartial(final Populater populater, final String ext) throws CQLException, Exception { final String typeName = "GeoWaveFeatureSourceTest_p" + ext; final SimpleFeatureType type = DataUtilities.createType( typeName, "geometry:Geometry:srid=4326,pop:java.lang.Long,pid:String,when:Date"); final DataStore dataStore = createDataStore(); populater.populate(type, dataStore); final SimpleFeatureSource source = dataStore.getFeatureSource(typeName); final Query query = new Query( typeName, CQL.toFilter( "BBOX(geometry,42,28,44,30) and when during 2005-05-01T20:32:56Z/2005-05-29T21:32:56Z"), new String[] {"geometry", "when", "pid"}); final ReferencedEnvelope env = source.getBounds(query); assertEquals(43.454, env.getMaxX(), 0.0001); assertEquals(28.232, env.getMinY(), 0.0001); assertEquals(28.242, env.getMaxY(), 0.0001); assertEquals(2, source.getCount(query)); }
Example #3
Source File: ElasticViewParametersFilterIT.java From elasticgeo with GNU General Public License v3.0 | 6 votes |
@Test public void testNativeTermQuery() throws Exception { init("not-active"); Map<String, String> vparams = new HashMap<>(); Map<String,Object> query = ImmutableMap.of("term", ImmutableMap.of("security_ss", "WPA")); vparams.put("q", mapper.writeValueAsString(query)); Hints hints = new Hints(Hints.VIRTUAL_TABLE_PARAMETERS, vparams); Query q = new Query(featureSource.getSchema().getTypeName()); q.setHints(hints); FilterFactory ff = dataStore.getFilterFactory(); PropertyIsEqualTo filter = ff.equals(ff.property("speed_is"), ff.literal("300")); q.setFilter(filter); ContentFeatureCollection features = featureSource.getFeatures(q); assertEquals(1, features.size()); SimpleFeatureIterator fsi = features.features(); assertTrue(fsi.hasNext()); assertEquals(fsi.next().getID(), "active.12"); }
Example #4
Source File: ExtractGeometryFilterVisitorTest.java From geowave with Apache License 2.0 | 6 votes |
@Test public void testIntesectAndCrossesAndLike() throws CQLException, TransformException, ParseException { // we are testing to see if we are able to combine dissimilar geometric // relations correctly // to extract query geometry. Note, that returned predicate is null // since we can't represent // CQL expression fully into single query geometry and predicate final Filter filter = CQL.toFilter( String.format( "CROSSES(%s, POLYGON((0 0, 0 25, 10 25, 10 0, 0 0))) AND location == 'abc'", geomAttributeName)); final Query query = new Query("type", filter); final ExtractGeometryFilterVisitorResult result = (ExtractGeometryFilterVisitorResult) query.getFilter().accept(visitorWithDescriptor, null); final Envelope bounds = new Envelope(0, 10, 0, 25); final Geometry bbox = new GeometryFactory().toGeometry(bounds); assertTrue(bbox.equalsTopo(result.getGeometry())); assertTrue(result.getCompareOp() == null); }
Example #5
Source File: GeoWaveFeatureReaderTest.java From geowave with Apache License 2.0 | 6 votes |
@Test public void testBBOX() throws IllegalArgumentException, NoSuchElementException, IOException { final FilterFactoryImpl factory = new FilterFactoryImpl(); final Query query = new Query( "GeoWaveFeatureReaderTest", factory.bbox("geometry", -180, -90, 180, 90, "EPSG:4326"), new String[] {"geometry", "pid"}); final FeatureReader<SimpleFeatureType, SimpleFeature> reader = dataStore.getFeatureReader(query, Transaction.AUTO_COMMIT); int count = 0; while (reader.hasNext()) { final SimpleFeature feature = reader.next(); assertTrue(fids.contains(feature.getID())); count++; } assertTrue(count > 0); }
Example #6
Source File: GeoToolsLayer.java From geomajas-project-server with GNU Affero General Public License v3.0 | 6 votes |
/** * {@inheritDoc} * */ @Transactional(readOnly = true) public Iterator<?> getElements(Filter filter, int offset, int maxResultSize) throws LayerException { FeatureSource<SimpleFeatureType, SimpleFeature> source = getFeatureSource(); try { if (source instanceof FeatureStore<?, ?>) { SimpleFeatureStore store = (SimpleFeatureStore) source; transactionSynchronization.synchTransaction(store); } Query query = new Query(); query.setFilter(filter); query.setMaxFeatures(maxResultSize > 0 ? maxResultSize : Integer.MAX_VALUE); query.setStartIndex(offset); FeatureCollection<SimpleFeatureType, SimpleFeature> fc = source.getFeatures(query); FeatureIterator<SimpleFeature> it = fc.features(); transactionSynchronization.addIterator(it); return new JavaIterator(it); } catch (Throwable t) { // NOSONAR avoid errors (like NPE) as well throw new LayerException(t, ExceptionCode.UNEXPECTED_PROBLEM); } }
Example #7
Source File: ElasticFeatureFilterIT.java From elasticgeo with GNU General Public License v3.0 | 6 votes |
@Test public void testGetFeaturesWithQuery() throws Exception { init(); FilterFactory ff = dataStore.getFilterFactory(); PropertyIsEqualTo filter = ff.equals(ff.property("modem_b"), ff.literal(true)); Query query = new Query(); query.setPropertyNames(new String[] { "standard_ss", "security_ss" }); query.setFilter(filter); SimpleFeatureCollection features = featureSource.getFeatures(query); assertEquals(8, features.size()); try (SimpleFeatureIterator iterator = features.features()) { assertTrue(iterator.hasNext()); SimpleFeature feature = iterator.next(); assertEquals(2, feature.getAttributeCount()); String st = (String) feature.getAttribute("standard_ss"); // changed from "IEEE 802.11b" in SolrFeatureSourceTest assertTrue(st.contains("IEEE 802.11b")); } }
Example #8
Source File: ElasticFeatureFilterIT.java From elasticgeo with GNU General Public License v3.0 | 6 votes |
@Test public void testGetFeaturesWithOffsetLimit() throws Exception { init(); Query q = new Query(featureSource.getSchema().getTypeName()); // no sorting, let's see if the database can use native one q.setStartIndex(1); q.setMaxFeatures(1); SimpleFeatureCollection features = featureSource.getFeatures(q); // check size assertEquals(1, features.size()); // check actual iteration try (SimpleFeatureIterator it = features.features()) { assertTrue(it.hasNext()); SimpleFeature f = it.next(); assertEquals(2, Integer.parseInt((String) f.getAttribute("id"))); assertFalse(it.hasNext()); } }
Example #9
Source File: ElasticFeatureFilterIT.java From elasticgeo with GNU General Public License v3.0 | 6 votes |
@Test public void testOnlyStoredFields() throws Exception { init(); Name name = new NameImpl("active"); for (final ElasticAttribute attribute : dataStore.getElasticAttributes(name) ){ if (!attribute.isStored()) { attribute.setUse(false); } } assertEquals(11, featureSource.getCount(Query.ALL)); SimpleFeatureIterator features = featureSource.getFeatures().features(); for (int i=0; i<11; i++) { assertTrue(features.hasNext()); features.next(); } }
Example #10
Source File: ElasticFeatureFilterIT.java From elasticgeo with GNU General Public License v3.0 | 6 votes |
@Test public void testOnlySourceFields() throws Exception { init(); Name name = new NameImpl("active"); for (final ElasticAttribute attribute : dataStore.getElasticAttributes(name) ){ if (attribute.isStored()) { attribute.setUse(false); } } featureSource = (ElasticFeatureSource) dataStore.getFeatureSource(TYPE_NAME); assertEquals(11, featureSource.getCount(Query.ALL)); SimpleFeatureIterator features = featureSource.getFeatures().features(); for (int i=0; i<11; i++) { assertTrue(features.hasNext()); features.next(); } }
Example #11
Source File: ElasticFeatureFilterIT.java From elasticgeo with GNU General Public License v3.0 | 6 votes |
@Test public void testOnlyStoredFieldsWithSourceFiltering() throws Exception { init(); dataStore.setSourceFilteringEnabled(true); Name name = new NameImpl("active"); for (final ElasticAttribute attribute : dataStore.getElasticAttributes(name) ){ if (!attribute.isStored()) { attribute.setUse(false); } } assertEquals(11, featureSource.getCount(Query.ALL)); SimpleFeatureIterator features = featureSource.getFeatures().features(); for (int i=0; i<11; i++) { assertTrue(features.hasNext()); features.next(); } }
Example #12
Source File: ElasticFeatureFilterIT.java From elasticgeo with GNU General Public License v3.0 | 6 votes |
@Test public void testOnlySourceFieldsWithSourceFiltering() throws Exception { init(); dataStore.setSourceFilteringEnabled(true); Name name = new NameImpl("active"); for (final ElasticAttribute attribute : dataStore.getElasticAttributes(name) ){ if (attribute.isStored()) { attribute.setUse(false); } } featureSource = (ElasticFeatureSource) dataStore.getFeatureSource(TYPE_NAME); assertEquals(11, featureSource.getCount(Query.ALL)); SimpleFeatureIterator features = featureSource.getFeatures().features(); for (int i=0; i<11; i++) { assertTrue(features.hasNext()); features.next(); } }
Example #13
Source File: GeoWaveFeatureReaderTest.java From rya with Apache License 2.0 | 6 votes |
@Test public void testFidFilterQuery() throws IllegalArgumentException, NoSuchElementException, IOException, CQLException { final String fidsString = fids.stream().collect(Collectors.joining("','", "'", "'")); final Filter filter = ECQL.toFilter("IN (" + fidsString + ")"); final Query query = new Query( "GeoWaveFeatureReaderTest", filter, new String[] { "geometry", "pid" }); final FeatureReader<SimpleFeatureType, SimpleFeature> reader = dataStore.getFeatureReader(query, Transaction.AUTO_COMMIT); int count = 0; while (reader.hasNext()) { final SimpleFeature feature = reader.next(); assertTrue(fids.contains(feature.getID())); count++; } assertTrue(count == fids.size()); }
Example #14
Source File: ExtractTimeFilterVisitorTest.java From geowave with Apache License 2.0 | 6 votes |
@Test public void testBefore() throws CQLException, ParseException { final ExtractTimeFilterVisitor visitor = new ExtractTimeFilterVisitor(); final Date etime = new Date(DateUtilities.parseISO("2005-05-19T20:32:56Z").getTime() - 1); final Filter filter = CQL.toFilter("when before 2005-05-19T20:32:56Z"); final Query query = new Query("type", filter); TemporalConstraints range = (TemporalConstraints) query.getFilter().accept(visitor, null); assertNotNull(range); assertEquals(TemporalRange.START_TIME, range.getStartRange().getStartTime()); assertEquals(etime, range.getStartRange().getEndTime()); range = (TemporalConstraints) query.getFilter().accept(visitorWithDescriptor, null); assertNotNull(range); assertEquals(TemporalRange.START_TIME, range.getStartRange().getStartTime()); assertEquals(etime, range.getStartRange().getEndTime()); }
Example #15
Source File: GeoWaveFeatureReaderTest.java From rya with Apache License 2.0 | 6 votes |
@Test public void testLike() throws IllegalArgumentException, NoSuchElementException, IOException, CQLException { final Query query = new Query( "GeoWaveFeatureReaderTest", ECQL.toFilter("pid like '" + pids.get( 0).substring( 0, 1) + "%'"), new String[] { "geometry", "pid" }); final FeatureReader<SimpleFeatureType, SimpleFeature> reader = dataStore.getFeatureReader(query, Transaction.AUTO_COMMIT); int count = 0; while (reader.hasNext()) { final SimpleFeature feature = reader.next(); assertTrue(fids.contains(feature.getID())); count++; } assertEquals(1, count); }
Example #16
Source File: ExtractTimeFilterVisitorTest.java From geowave with Apache License 2.0 | 6 votes |
@Test public void testBeforeOrDuring() throws CQLException, ParseException { final ExtractTimeFilterVisitor visitor = new ExtractTimeFilterVisitor(); final Date stime = new Date(DateUtilities.parseISO("2005-05-19T21:32:56Z").getTime() - 1); final Filter filter = CQL.toFilter("when BEFORE OR DURING 2005-05-19T20:32:56Z/2005-05-19T21:32:56Z"); final Query query = new Query("type", filter); TemporalConstraintsSet rangeSet = (TemporalConstraintsSet) query.getFilter().accept(visitor, null); assertNotNull(rangeSet); assertEquals( TemporalRange.START_TIME, rangeSet.getConstraintsFor("when").getStartRange().getStartTime()); assertEquals(stime, rangeSet.getConstraintsFor("when").getEndRange().getEndTime()); rangeSet = (TemporalConstraintsSet) query.getFilter().accept(visitorWithDescriptor, null); assertNotNull(rangeSet); assertEquals( TemporalRange.START_TIME, rangeSet.getConstraintsFor("when").getStartRange().getStartTime()); assertEquals(stime, rangeSet.getConstraintsFor("when").getEndRange().getEndTime()); }
Example #17
Source File: GeoToolsAttributesSubsetTest.java From geowave with Apache License 2.0 | 6 votes |
@Test public void testSubsetAttributes() throws CQLException, IOException { final Query query = new Query( typeName, CQL.toFilter(cqlPredicate), new String[] {geometry_attribute, string_attribute}); final FeatureReader<SimpleFeatureType, SimpleFeature> reader = geotoolsDataStore.getFeatureReader(query, Transaction.AUTO_COMMIT); int count = 0; while (reader.hasNext()) { final SimpleFeature feature = reader.next(); count++; Assert.assertTrue(feature.getAttribute(geometry_attribute) != null); Assert.assertTrue(feature.getAttribute(long_attribute) == null); Assert.assertTrue(feature.getAttribute(string_attribute) != null); } Assert.assertTrue(count == 3); }
Example #18
Source File: GeoWaveFeatureCollection.java From geowave with Apache License 2.0 | 6 votes |
private Geometry getBBox(final Query query, final ReferencedEnvelope envelope) { if (envelope != null) { return new GeometryFactory().toGeometry(envelope); } final String geomAtrributeName = reader.getComponents().getAdapter().getFeatureType().getGeometryDescriptor().getLocalName(); final ExtractGeometryFilterVisitorResult geoAndCompareOp = ExtractGeometryFilterVisitor.getConstraints( query.getFilter(), reader.getComponents().getAdapter().getFeatureType().getCoordinateReferenceSystem(), geomAtrributeName); if (geoAndCompareOp == null) { return reader.clipIndexedBBOXConstraints(null); } else { return reader.clipIndexedBBOXConstraints(geoAndCompareOp.getGeometry()); } }
Example #19
Source File: GeoWaveFeatureReaderTest.java From geowave with Apache License 2.0 | 6 votes |
@Test public void testLike() throws IllegalArgumentException, NoSuchElementException, IOException, CQLException { System.out.println(pids); final Query query = new Query( "GeoWaveFeatureReaderTest", ECQL.toFilter("pid like '" + pids.get(0).substring(0, 1) + "%'"), new String[] {"geometry", "pid"}); final FeatureReader<SimpleFeatureType, SimpleFeature> reader = dataStore.getFeatureReader(query, Transaction.AUTO_COMMIT); int count = 0; while (reader.hasNext()) { final SimpleFeature feature = reader.next(); assertTrue(fids.contains(feature.getID())); count++; } assertEquals(1, count); }
Example #20
Source File: GeoWaveFeatureSource.java From geowave with Apache License 2.0 | 6 votes |
@SuppressWarnings("rawtypes") @Override protected int getCountInternal(final Query query) throws IOException { final Map<StatisticsId, InternalDataStatistics<SimpleFeature, ?, ?>> stats = new GeoWaveEmptyTransaction(components).getDataStatistics(); final InternalDataStatistics<SimpleFeature, ?, ?> countStats = stats.get(VectorStatisticsQueryBuilder.newBuilder().factory().count().build().getId()); if ((countStats != null) && query.getFilter().equals(Filter.INCLUDE)) { return (int) ((CountDataStatistics) countStats).getCount(); } else { try (GeoWaveFeatureReader reader = new GeoWaveFeatureReader(query, new GeoWaveEmptyTransaction(components), components)) { return (int) reader.getCount(); } } }
Example #21
Source File: WFSTemporalQueryTest.java From geowave with Apache License 2.0 | 6 votes |
@Test public void testTemporal() throws CQLException, IOException, ParseException { populate(); final Transaction transaction2 = new DefaultTransaction(); final Query query = new Query( "geostuff", CQL.toFilter( "BBOX(geometry,44,27,42,30) and start during 2005-05-16T20:32:56Z/2005-05-20T21:32:56Z and end during 2005-05-18T20:32:56Z/2005-05-22T21:32:56Z"), new String[] {"geometry", "start", "end", "pid"}); final FeatureReader<SimpleFeatureType, SimpleFeature> reader = dataStore.getFeatureReader(query, transaction2); int c = 0; while (reader.hasNext()) { reader.next(); c++; } reader.close(); transaction2.commit(); transaction2.close(); assertEquals(2, c); }
Example #22
Source File: WFSSpatialTest.java From geowave with Apache License 2.0 | 6 votes |
@Before public void setup() throws SchemaException, CQLException, IOException, GeoWavePluginException { dataStore = createDataStore(); type = DataUtilities.createType( "geostuff", "geometry:Geometry:srid=4326,pop:java.lang.Long,when:Date,pid:String"); dataStore.createSchema(type); query = new Query( "geostuff", CQL.toFilter( "BBOX(geometry,27.20,41.30,27.30,41.20) and when during 2005-05-19T20:32:56Z/2005-05-19T21:32:56Z"), new String[] {"geometry", "pid"}); }
Example #23
Source File: ExtractGeometryFilterVisitorTest.java From geowave with Apache License 2.0 | 6 votes |
@Test public void testDWithin() throws CQLException, TransformException, ParseException { final Filter filter = CQL.toFilter( String.format( "DWITHIN(%s, POINT(-122.7668 0.4979), 233.7, meters)", geomAttributeName)); final Query query = new Query("type", filter); final ExtractGeometryFilterVisitorResult result = (ExtractGeometryFilterVisitorResult) query.getFilter().accept(visitorWithDescriptor, null); final Geometry geometry = result.getGeometry(); assertNotNull(geometry); for (final Coordinate coord : geometry.getCoordinates()) { assertEquals( 233.7, JTS.orthodromicDistance( coord, new Coordinate(-122.7668, 0.4979), GeometryUtils.getDefaultCRS()), 2); } }
Example #24
Source File: ExtractGeometryFilterVisitorTest.java From geowave with Apache License 2.0 | 6 votes |
@Test public void testIntersects() throws CQLException, TransformException, ParseException { final Filter filter = CQL.toFilter( String.format( "INTERSECTS(%s, POLYGON((0 0, 0 25, 10 25, 10 0, 0 0)))", geomAttributeName)); final Query query = new Query("type", filter); final ExtractGeometryFilterVisitorResult result = (ExtractGeometryFilterVisitorResult) query.getFilter().accept(visitorWithDescriptor, null); final Envelope bounds = new Envelope(0, 10, 0, 25); final Geometry bbox = new GeometryFactory().toGeometry(bounds); assertTrue(bbox.equalsTopo(result.getGeometry())); assertTrue(result.getCompareOp() == CompareOperation.INTERSECTS); }
Example #25
Source File: ExtractGeometryFilterVisitorTest.java From geowave with Apache License 2.0 | 6 votes |
@Test public void testOverlaps() throws CQLException, TransformException, ParseException { final Filter filter = CQL.toFilter( String.format( "OVERLAPS(%s, POLYGON((0 0, 0 25, 10 25, 10 0, 0 0)))", geomAttributeName)); final Query query = new Query("type", filter); final ExtractGeometryFilterVisitorResult result = (ExtractGeometryFilterVisitorResult) query.getFilter().accept(visitorWithDescriptor, null); final Envelope bounds = new Envelope(0, 10, 0, 25); final Geometry bbox = new GeometryFactory().toGeometry(bounds); assertTrue(bbox.equalsTopo(result.getGeometry())); assertTrue(result.getCompareOp() == CompareOperation.OVERLAPS); }
Example #26
Source File: ExtractGeometryFilterVisitorTest.java From geowave with Apache License 2.0 | 6 votes |
@Test public void testEquals() throws CQLException, TransformException, ParseException { final Filter filter = CQL.toFilter( String.format( "EQUALS(geom, POLYGON((0 0, 0 25, 10 25, 10 0, 0 0)))", geomAttributeName)); final Query query = new Query("type", filter); final ExtractGeometryFilterVisitorResult result = (ExtractGeometryFilterVisitorResult) query.getFilter().accept(visitorWithDescriptor, null); final Envelope bounds = new Envelope(0, 10, 0, 25); final Geometry bbox = new GeometryFactory().toGeometry(bounds); assertTrue(bbox.equalsTopo(result.getGeometry())); assertTrue(result.getCompareOp() == CompareOperation.EQUALS); }
Example #27
Source File: ExtractGeometryFilterVisitorTest.java From geowave with Apache License 2.0 | 6 votes |
@Test public void testTouches() throws CQLException, TransformException, ParseException { final Filter filter = CQL.toFilter( String.format( "TOUCHES(%s, POLYGON((0 0, 0 25, 10 25, 10 0, 0 0)))", geomAttributeName)); final Query query = new Query("type", filter); final ExtractGeometryFilterVisitorResult result = (ExtractGeometryFilterVisitorResult) query.getFilter().accept(visitorWithDescriptor, null); final Envelope bounds = new Envelope(0, 10, 0, 25); final Geometry bbox = new GeometryFactory().toGeometry(bounds); assertTrue(bbox.equalsTopo(result.getGeometry())); assertTrue(result.getCompareOp() == CompareOperation.TOUCHES); }
Example #28
Source File: ExtractGeometryFilterVisitorTest.java From geowave with Apache License 2.0 | 6 votes |
@Test public void testContains() throws CQLException, TransformException, ParseException { final Filter filter = CQL.toFilter( String.format( "CONTAINS(geom, POLYGON((0 0, 0 25, 10 25, 10 0, 0 0)))", geomAttributeName)); final Query query = new Query("type", filter); final ExtractGeometryFilterVisitorResult result = (ExtractGeometryFilterVisitorResult) query.getFilter().accept(visitorWithDescriptor, null); final Envelope bounds = new Envelope(0, 10, 0, 25); final Geometry bbox = new GeometryFactory().toGeometry(bounds); assertTrue(bbox.equalsTopo(result.getGeometry())); assertTrue(result.getCompareOp() == CompareOperation.WITHIN); }
Example #29
Source File: ExtractGeometryFilterVisitorTest.java From geowave with Apache License 2.0 | 6 votes |
@Test public void testDisjoint() throws CQLException, TransformException, ParseException { final Filter filter = CQL.toFilter( String.format( "DISJOINT(%s, POLYGON((0 0, 0 25, 10 25, 10 0, 0 0)))", geomAttributeName)); final Query query = new Query("type", filter); final ExtractGeometryFilterVisitorResult result = (ExtractGeometryFilterVisitorResult) query.getFilter().accept(visitorWithDescriptor, null); // for non-inclusive filters we can't extract query geometry and // predicate // assertTrue(Double.isNaN(result.getGeometry().getArea())); assertTrue(result.getCompareOp() == null); }
Example #30
Source File: ExtractGeometryFilterVisitorTest.java From geowave with Apache License 2.0 | 6 votes |
@Test public void testIntesectAndBBox() throws CQLException, TransformException, ParseException { // BBOX geometry is completely contained within Intersects geometry // we are testing to see if we are able to combine simple geometric // relations with similar predicates // into a single query geometry/predicate final Filter filter = CQL.toFilter( String.format( "INTERSECTS(%s, POLYGON((0 0, 0 50, 20 50, 20 0, 0 0))) AND BBOX(%s, 0, 0, 10, 25)", geomAttributeName, geomAttributeName)); final Query query = new Query("type", filter); final ExtractGeometryFilterVisitorResult result = (ExtractGeometryFilterVisitorResult) query.getFilter().accept(visitorWithDescriptor, null); final Envelope bounds = new Envelope(0, 10, 0, 25); final Geometry bbox = new GeometryFactory().toGeometry(bounds); assertTrue(bbox.equalsTopo(result.getGeometry())); assertTrue(result.getCompareOp() == CompareOperation.INTERSECTS); }