@Test public void testGeometryFilter() throws Exception { File shpFile = copyShapefiles(STREAM); URL url = shpFile.toURI().toURL(); ShapefileDataStore ds = new ShapefileDataStore(url); SimpleFeatureSource featureSource = ds.getFeatureSource(); SimpleFeatureCollection features; GeometryFactory geometryFactory = new GeometryFactory(); Coordinate coordinate = new Coordinate(-99.0, 38.0); Point p = geometryFactory.createPoint(coordinate); FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); final Filter testFilter = ff.intersects(ff.literal(p), ff.property("the_geom")); features = featureSource.getFeatures(testFilter); assertNotNull(features); }
public ContentFeatureSource getFeatureSource() throws IOException { ContentEntry entry = ensureEntry(getTypeName()); if (shpFiles.isWritable()) { return new ShapefileFeatureStore(entry, shpFiles); } else { return new ShapefileFeatureSource(entry, shpFiles); } }
ShapefileDataStore extends ContentDataStore implements FileDataStore { public ContentFeatureSource getFeatureSource() throws IOException { ContentEntry entry = ensureEntry(getTypeName()); if (shpFiles.isWritable()) { return new ShapefileFeatureStore(entry, shpFiles); } else { return new ShapefileFeatureSource(entry, shpFiles); } } }
ShapefileDataStore extends ContentDataStore implements FileDataStore { public ContentFeatureSource getFeatureSource() throws IOException { ContentEntry entry = ensureEntry(getTypeName()); if (shpFiles.isWritable()) { return new ShapefileFeatureStore(entry, shpFiles); } else { return new ShapefileFeatureSource(entry, shpFiles); } } ShapefileDataStore(URL url); }
ShapefileDataStore extends ContentDataStore implements FileDataStore { public ContentFeatureSource getFeatureSource() throws IOException { ContentEntry entry = ensureEntry(getTypeName()); if (shpFiles.isWritable()) { return new ShapefileFeatureStore(entry, shpFiles); } else { return new ShapefileFeatureSource(entry, shpFiles); } } ShapefileDataStore(URL url); ContentFeatureSource getFeatureSource(); Charset getCharset(); void setCharset(Charset charset); TimeZone getTimeZone(); void setTimeZone(TimeZone timeZone); boolean isMemoryMapped(); void setMemoryMapped(boolean memoryMapped); boolean isBufferCachingEnabled(); void setBufferCachingEnabled(boolean bufferCachingEnabled); boolean isIndexed(); void setIndexed(boolean indexed); SimpleFeatureType getSchema(); FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader(); long getCount(Query query); void createSchema(SimpleFeatureType featureType); void forceSchemaCRS(CoordinateReferenceSystem crs); @Override void dispose(); boolean isFidIndexed(); void setFidIndexed(boolean fidIndexed); @Override String toString(); @Override void updateSchema(SimpleFeatureType featureType); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(
            Filter filter, Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriterAppend(
            Transaction transaction); boolean isIndexCreationEnabled(); void setIndexCreationEnabled(boolean indexCreationEnabled); @Override void removeSchema(String typeName); @Override void removeSchema(Name typeName); }
ShapefileDataStore extends ContentDataStore implements FileDataStore { public ContentFeatureSource getFeatureSource() throws IOException { ContentEntry entry = ensureEntry(getTypeName()); if (shpFiles.isWritable()) { return new ShapefileFeatureStore(entry, shpFiles); } else { return new ShapefileFeatureSource(entry, shpFiles); } } ShapefileDataStore(URL url); ContentFeatureSource getFeatureSource(); Charset getCharset(); void setCharset(Charset charset); TimeZone getTimeZone(); void setTimeZone(TimeZone timeZone); boolean isMemoryMapped(); void setMemoryMapped(boolean memoryMapped); boolean isBufferCachingEnabled(); void setBufferCachingEnabled(boolean bufferCachingEnabled); boolean isIndexed(); void setIndexed(boolean indexed); SimpleFeatureType getSchema(); FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader(); long getCount(Query query); void createSchema(SimpleFeatureType featureType); void forceSchemaCRS(CoordinateReferenceSystem crs); @Override void dispose(); boolean isFidIndexed(); void setFidIndexed(boolean fidIndexed); @Override String toString(); @Override void updateSchema(SimpleFeatureType featureType); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(
            Filter filter, Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriterAppend(
            Transaction transaction); boolean isIndexCreationEnabled(); void setIndexCreationEnabled(boolean indexCreationEnabled); @Override void removeSchema(String typeName); @Override void removeSchema(Name typeName); static final String ORIGINAL_FIELD_NAME; static final String ORIGINAL_FIELD_DUPLICITY_COUNT; static final Charset DEFAULT_STRING_CHARSET; static final TimeZone DEFAULT_TIMEZONE; }