@Test public void testFeatures() throws IOException { URL url = TestData.url(GeoJSONDataStore.class, "featureCollection.json"); GeoJSONDataStore fds = new GeoJSONDataStore(url); String type = fds.getNames().get(0).getLocalPart(); Query query = new Query(type); try (FeatureReader<SimpleFeatureType, SimpleFeature> reader = fds.getFeatureReader(query, null)) { SimpleFeatureType schema = reader.getFeatureType(); assertTrue( Geometry.class.isAssignableFrom( schema.getGeometryDescriptor().getType().getBinding())); assertNotNull(schema); int count = 0; while (reader.hasNext()) { reader.next(); count++; } assertEquals(7, count); } }
@Override public FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader() throws IOException { return new GeoJSONFeatureSource(this).getReader(); }
GeoJSONDataStore extends ContentDataStore implements FileDataStore { @Override public FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader() throws IOException { return new GeoJSONFeatureSource(this).getReader(); } }
GeoJSONDataStore extends ContentDataStore implements FileDataStore { @Override public FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader() throws IOException { return new GeoJSONFeatureSource(this).getReader(); } GeoJSONDataStore(URL url);  GeoJSONDataStore(File f); }
GeoJSONDataStore extends ContentDataStore implements FileDataStore { @Override public FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader() throws IOException { return new GeoJSONFeatureSource(this).getReader(); } GeoJSONDataStore(URL url);  GeoJSONDataStore(File f); @Override void createSchema(SimpleFeatureType featureType); @Override SimpleFeatureType getSchema(); @Override void updateSchema(SimpleFeatureType featureType); CoordinateReferenceSystem getCrs(); void setCrs(CoordinateReferenceSystem crs); URL getUrl(); void setUrl(URL url); @Override SimpleFeatureSource getFeatureSource(); @Override FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader(); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(
            Filter filter, Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriterAppend(
            Transaction transaction); Name getTypeName(); }
GeoJSONDataStore extends ContentDataStore implements FileDataStore { @Override public FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader() throws IOException { return new GeoJSONFeatureSource(this).getReader(); } GeoJSONDataStore(URL url);  GeoJSONDataStore(File f); @Override void createSchema(SimpleFeatureType featureType); @Override SimpleFeatureType getSchema(); @Override void updateSchema(SimpleFeatureType featureType); CoordinateReferenceSystem getCrs(); void setCrs(CoordinateReferenceSystem crs); URL getUrl(); void setUrl(URL url); @Override SimpleFeatureSource getFeatureSource(); @Override FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader(); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(
            Filter filter, Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriterAppend(
            Transaction transaction); Name getTypeName();  }