public Name getName() { return delegate.getName(); }
public Name getName() { return wrapped.getName(); }
public Name getName() { return fsource.getName(); }
featureSource = (SimpleFeatureSource) entry.getKey(); if (!featureSource.getName().getLocalPart().equals(typeName)) { continue; // skip as typeName does not match
protected void delegateVisitor(FeatureVisitor visitor, ProgressListener progress) throws IOException { Name typeName = transformer.getSource().getName(); Query txQuery = transformer.transformQuery(query); source.getDataStore() .getFeatureSource(typeName) .getFeatures(txQuery) .accepts(visitor, progress); } }
protected Query getProxyObject(Query query, SimpleFeatureSource fs) { String baseGeomPropertyName = info.getGeomPropertyName(); // generalized geom property String backendGeomPropertyName = getBackendGeometryName(fs); String[] originalPropNames = query.getPropertyNames(); String[] newPropNames; if (originalPropNames == Query.ALL_NAMES) { newPropNames = new String[getSchema().getAttributeCount()]; for (int i = 0; i < newPropNames.length; i++) { AttributeDescriptor attrDescr = getSchema().getAttributeDescriptors().get(i); newPropNames[i] = attrDescr.getLocalName().equals(baseGeomPropertyName) ? backendGeomPropertyName : attrDescr.getLocalName(); } } else { newPropNames = new String[originalPropNames.length]; for (int i = 0; i < newPropNames.length; i++) { newPropNames[i] = originalPropNames[i].equals(baseGeomPropertyName) ? backendGeomPropertyName : originalPropNames[i]; } } Query newQuery = new Query(query); newQuery.setTypeName(fs.getName().getLocalPart()); newQuery.setPropertyNames(newPropNames); return newQuery; }
public Name getName() { return fsource.getName(); }
public Name getName() { return wrapped.getName(); }
public void testDataStore() throws IOException { SimpleFeatureSource features = DataUtilities.source(roadFeatures); Name name = features.getName(); String typeName = name.getLocalPart(); DataStore store = DataUtilities.dataStore(features); assertSame(features.getSchema(), store.getSchema(name)); assertSame(features.getSchema(), store.getSchema(typeName)); assertSame(features, store.getFeatureSource(name)); assertSame(features, store.getFeatureSource(typeName)); assertEquals(name, store.getNames().get(0)); assertEquals(typeName, store.getTypeNames()[0]); }
featureSource = (SimpleFeatureSource) entry.getKey(); if (!featureSource.getName().getLocalPart().equals(typeName)) { continue; // skip as typeName does not match
@Override public FormClass getFormClass() { FormClass formClass = new FormClass(resourceId); formClass.setLabel(featureSource.getName().getLocalPart()); List<AttributeDescriptor> attributes = featureSource.getSchema().getAttributeDescriptors(); for (int i = 0; i < attributes.size(); i++) { AttributeDescriptor attribute = attributes.get(i); formClass.addElement(toField(i, attribute)); } return formClass; }
dataStore.getEntry(featureSource.getName()).getState(transaction).setFeatureType(simpleFeatureType); try { featureStore.addFeatures(collection);
protected IFeatureInserter getTransactionFeatureStore(SimpleFeatureType featureType) { // create feature store SimpleFeatureStore featureStore = null; try { getOutputDataStore().createSchema(featureType); String typeName = featureType.getTypeName(); SimpleFeatureSource sfs = getOutputDataStore().getFeatureSource(typeName); if (sfs instanceof SimpleFeatureStore) { featureStore = (SimpleFeatureStore) sfs; Transaction transaction = new DefaultTransaction(typeName); featureStore.setTransaction(transaction); return new FeatureInserter(featureStore); } else { LOGGER.log(Level.FINE, sfs.getName().toString() + " does not support SimpleFeatureStore interface!"); } } catch (IOException e) { LOGGER.log(Level.FINE, e.getMessage(), e); } return null; }
protected Query getProxyObject(Query query, SimpleFeatureSource fs) { String baseGeomPropertyName = info.getGeomPropertyName(); // generalized geom property String backendGeomPropertyName = getBackendGeometryName(fs); String[] originalPropNames = query.getPropertyNames(); String[] newPropNames; if (originalPropNames == Query.ALL_NAMES) { newPropNames = new String[getSchema().getAttributeCount()]; for (int i = 0; i < newPropNames.length; i++) { AttributeDescriptor attrDescr = getSchema().getAttributeDescriptors().get(i); newPropNames[i] = attrDescr.getLocalName().equals(baseGeomPropertyName) ? backendGeomPropertyName : attrDescr.getLocalName(); } } else { newPropNames = new String[originalPropNames.length]; for (int i = 0; i < newPropNames.length; i++) { newPropNames[i] = originalPropNames[i].equals(baseGeomPropertyName) ? backendGeomPropertyName : originalPropNames[i]; } } Query newQuery = new Query(query); newQuery.setTypeName(fs.getName().getLocalPart()); newQuery.setPropertyNames(newPropNames); return newQuery; }
@Test public void testGetLocalName() { assertEquals(pointsName, pointsSource.getName().getLocalPart()); assertEquals(linesName, linesSource.getName().getLocalPart()); }
gpkg.createSchema(source.getSchema()); SimpleFeatureStore store; store = (SimpleFeatureStore) gpkg.getFeatureSource(source.getName().getLocalPart()); Preconditions.checkState(store.getQueryCapabilities().isUseProvidedFIDSupported()); store.setTransaction(gttx); metadata.createFidMappingTable(source.getName().getLocalPart(), mappings);
gpkg.createSchema(source.getSchema()); SimpleFeatureStore store; store = (SimpleFeatureStore) gpkg.getFeatureSource(source.getName().getLocalPart()); Preconditions.checkState(store.getQueryCapabilities().isUseProvidedFIDSupported()); store.setTransaction(gttx); metadata.createFidMappingTable(source.getName().getLocalPart(), mappings);
@Test public void testGetFeatureSourceProvidedNamespace() throws Exception { String namespace = "http://www.geogig.org/test"; dataStore.setNamespaceURI(namespace); insertAndAdd(lines1); commit(); SimpleFeatureSource lines; lines = dataStore.getFeatureSource(linesName); Name expectedName = new NameImpl(namespace, linesName); assertEquals(expectedName, lines.getName()); SimpleFeatureType schema = lines.getSchema(); assertEquals(expectedName, schema.getName()); SimpleFeatureCollection features = lines.getFeatures(); assertEquals(expectedName, features.getSchema().getName()); try (SimpleFeatureIterator it = features.features()) { SimpleFeature feature = it.next(); assertEquals(expectedName, feature.getType().getName()); } }
@Test public void testGetFeatureSourceProvidedNamespace() throws Exception { String namespace = "http://www.geogig.org/test"; dataStore.setNamespaceURI(namespace); insertAndAdd(lines1); commit(); SimpleFeatureSource lines; lines = dataStore.getFeatureSource(linesName); Name expectedName = new NameImpl(namespace, linesName); assertEquals(expectedName, lines.getName()); SimpleFeatureType schema = lines.getSchema(); assertEquals(expectedName, schema.getName()); SimpleFeatureCollection features = lines.getFeatures(); assertEquals(expectedName, features.getSchema().getName()); try (SimpleFeatureIterator it = features.features()) { SimpleFeature feature = it.next(); assertEquals(expectedName, feature.getType().getName()); } }