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

The following examples show how to use org.opengis.filter.FilterFactory#bbox() . 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: ElasticGeometryFilterIT.java    From elasticgeo with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void testBBOXFilter() throws Exception {
    init();
    FilterFactory ff = dataStore.getFilterFactory();
    BBOX bbox = ff.bbox("geo", -180, -98, 180, 98, "EPSG:" + SOURCE_SRID);
    SimpleFeatureCollection features = featureSource.getFeatures(bbox);
    assertEquals(11, features.size());
}
 
Example 2
Source File: ElasticGeometryFilterIT.java    From elasticgeo with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void testBBOXAndEqualsFilter() throws Exception {
    init();
    FilterFactory ff = dataStore.getFilterFactory();
    PropertyIsEqualTo property = ff.equals(ff.property("standard_ss"),
            ff.literal("IEEE 802.11b"));
    BBOX bbox = ff.bbox("geo", -180, -180, 180, 180, "EPSG:" + SOURCE_SRID);
    And filter = ff.and(property, bbox);
    SimpleFeatureCollection features = featureSource.getFeatures(filter);
    assertEquals(7, features.size());
}
 
Example 3
Source File: ElasticGeometryFilterIT.java    From elasticgeo with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void testBBOXCoveringDateline() throws Exception {
    init("not-active","geo");
    FilterFactory ff = dataStore.getFilterFactory();
    BBOX bbox = ff.bbox("geo", 178, -90, 182, 90, "EPSG:" + SOURCE_SRID);
    SimpleFeatureCollection features = featureSource.getFeatures(bbox);
    assertEquals(2, features.size());
}
 
Example 4
Source File: ElasticGeometryFilterIT.java    From elasticgeo with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void testBBOXBeyondDateline() throws Exception {
    init("not-active","geo");
    FilterFactory ff = dataStore.getFilterFactory();
    BBOX bbox = ff.bbox("geo", 180.5, -90, 182, 90, "EPSG:" + SOURCE_SRID);
    SimpleFeatureCollection features = featureSource.getFeatures(bbox);
    assertEquals(1, features.size());
}
 
Example 5
Source File: ElasticFeatureFilterIT.java    From elasticgeo with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void testGetFeaturesWithAndLogicFilter() throws Exception {
    init();
    FilterFactory ff = dataStore.getFilterFactory();
    PropertyIsEqualTo property = ff.equals(ff.property("standard_ss"),
            ff.literal("IEEE 802.11b"));
    BBOX bbox = ff.bbox("geo", -1, -1, 10, 10, "EPSG:" + SOURCE_SRID);
    And filter = ff.and(property, bbox);
    SimpleFeatureCollection features = featureSource.getFeatures(filter);
    assertEquals(3, features.size());
}
 
Example 6
Source File: ElasticFeatureFilterIT.java    From elasticgeo with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void testBBOXFilterWithBBOXType() throws Exception {
    init();
    FilterFactory ff = dataStore.getFilterFactory();
    Filter f = ff.bbox("geo3", 12.5, 7.5, 14, 19, "epsg:4326");

    SimpleFeatureCollection features = featureSource.getFeatures(f);
    assertCovered(features, 2, 5, 6);
}