Java Code Examples for org.opengis.filter.FilterFactory#between()

The following examples show how to use org.opengis.filter.FilterFactory#between() . 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: ElasticFeatureFilterIT.java    From elasticgeo with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void testReadNumericArrayWithCsvStrategy() throws Exception {
    init();
    dataStore.setArrayEncoding(ArrayEncoding.CSV);
    FilterFactory ff = dataStore.getFilterFactory();
    PropertyIsBetween between = ff.between(ff.property("speed_is"), ff.literal(160), ff.literal(300));
    SimpleFeatureCollection features = featureSource.getFeatures(between);
    assertEquals(5, features.size());
    SimpleFeatureIterator iterator = features.features();
    while (iterator.hasNext()) {
        SimpleFeature f = iterator.next();
        assertFalse(f.getAttribute("speed_is") instanceof List);
    }
}
 
Example 2
Source File: ElasticFeatureFilterIT.java    From elasticgeo with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void testGetFeaturesWithIsBetweenFilterOnObjectType() throws Exception {
    init();
    FilterFactory ff = dataStore.getFilterFactory();
    PropertyIsBetween f = ff.between(ff.property("object.hejda"), ff.literal(5), ff.literal(15));
    SimpleFeatureCollection features = featureSource.getFeatures(f);
    assertEquals(5, features.size());
}
 
Example 3
Source File: ElasticFeatureFilterIT.java    From elasticgeo with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void testGetFeaturesWithIsBetweenFilterOnNestedType() throws Exception {
    init();
    FilterFactory ff = dataStore.getFilterFactory();
    PropertyIsBetween f = ff.between(ff.property("nested.hej"), ff.literal(5), ff.literal(15));
    SimpleFeatureCollection features = featureSource.getFeatures(f);
    assertEquals(10, features.size());
}