Java Code Examples for org.geotools.filter.FilterFactoryImpl#bbox()

The following examples show how to use org.geotools.filter.FilterFactoryImpl#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: GeoWaveFeatureReaderTest.java    From geowave with Apache License 2.0 6 votes vote down vote up
@Test
public void testSmallBBOX() throws IllegalArgumentException, NoSuchElementException, IOException {
  final FilterFactoryImpl factory = new FilterFactoryImpl();
  final Query query =
      new Query(
          "GeoWaveFeatureReaderTest",
          factory.bbox("geometry", 28, 41, 28.5, 41.5, "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++;
  }
  assertEquals(1, count);
}
 
Example 2
Source File: GeoWaveFeatureReaderTest.java    From geowave with Apache License 2.0 6 votes vote down vote up
@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 3
Source File: GeoWaveFeatureReaderTest.java    From rya with Apache License 2.0 5 votes vote down vote up
@Test
public void testBBOX() throws IllegalArgumentException, NoSuchElementException, IOException {
    final FilterFactoryImpl factory = new FilterFactoryImpl();
    final Query query = new Query(
            "GeoWaveFeatureReaderTest",
            factory.bbox(
                    "",
                    -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);
}