use of org.geotools.feature.simple.SimpleFeatureImpl in project polymap4-core by Polymap4.
the class RFeatureStoreTests method testCreateSimpleSchemaAndFeatureWithoutId.
public void testCreateSimpleSchemaAndFeatureWithoutId() throws Exception {
log.debug("creating schema...");
SimpleFeatureType schema = createSimpleSchema();
ds.createSchema(schema);
RFeatureStore fs = (RFeatureStore) ds.getFeatureSource(schema.getName());
assertEquals(0, Iterables.size(iterable(fs.getFeatures())));
// add feature
// SimpleFeatureBuilder always creates a default id
DefaultFeatureCollection features = new DefaultFeatureCollection();
features.add(new SimpleFeatureImpl(Lists.newArrayList("value", null), schema, null));
fs.addFeatures(features);
// check size
assertEquals(1, Iterables.size(iterable(fs.getFeatures())));
}
Aggregations