FeatureType ft = schema.getFeatureType( ftName ); if ( schema.getFtMapping( ft.getName() ) != null ) { writeFeatureTypeMapping( writer, ft );
FeatureType ft = getSchema().getFeatureType( ftName ); checkIfFeatureTypIsRequested( typeNames, ft ); FeatureTypeMapping ftMapping = getSchema().getFtMapping( ftName );
FeatureType ft = getSchema().getFeatureType( ftName ); FeatureTypeMapping ftMapping = getMapping( ftName ); if ( ftMapping == null ) {
if ( mapping.getValueFtName() != null ) { ftName = mapping.getValueFtName(); if ( getSchema().getFeatureType( ftName ).isAbstract() ) { FeatureType[] concreteSubtypes = getSchema().getConcreteSubtypes( getSchema().getFeatureType( ftName ) ); if ( concreteSubtypes.length == 0 ) { String msg = "Error in mapping. Feature-particle mapping " + mapping throw new FeatureStoreException( msg ); ftName = getSchema().getConcreteSubtypes( getSchema().getFeatureType( ftName ) )[0].getName();
throws SQLException, FeatureStoreException { LOG.debug( "Inserting feature with id '" + feature.getId() + "' (BLOB)" ); if ( fs.getSchema().getFeatureType( feature.getName() ) == null ) { throw new FeatureStoreException( "Cannot insert feature '" + feature.getName() + "': feature type is not served by this feature store." );
valueFt = schema.getFeatureType( fm.getValueFtName() );
ResultSet rs = null; FeatureType ft = getSchema().getFeatureType( ftName ); FeatureTypeMapping ftMapping = getMapping( ftName ); if ( ftMapping == null ) {
Envelope calcEnvelope( QName ftName, Connection conn ) throws FeatureStoreException { Envelope env = null; FeatureType ft = schema.getFeatureType( ftName ); if ( ft != null ) { // TODO what should be favored for hybrid mappings? if ( blobMapping != null ) { env = calcEnvelope( ftName, blobMapping, conn ); } else if ( schema.getFtMapping( ft.getName() ) != null ) { FeatureTypeMapping ftMapping = schema.getFtMapping( ft.getName() ); env = calcEnvelope( ftMapping, conn ); } } bboxCache.set( ftName, env ); return env; }
private void addRelationallyMappedMultiProperty( ParsedPropertyReplacement replacement, Mapping mapping, FeatureTypeMapping ftMapping, List<ResourceId> list ) throws FilterEvaluationException, FeatureStoreException, SQLException { UpdateAction action = replacement.getUpdateAction(); if ( action == null ) { action = UpdateAction.INSERT_AFTER; } switch ( action ) { case INSERT_BEFORE: case REMOVE: case REPLACE: LOG.warn( "Updating of multi properties is currently only supported for 'insertAfter' update action. Omitting." ); break; case INSERT_AFTER: break; default: break; } InsertRowManager mgr = new InsertRowManager( fs, conn, null ); List<Property> props = Collections.singletonList( replacement.getNewValue() ); for ( ResourceId id : list ) { IdAnalysis analysis = schema.analyzeId( id.getRid() ); FeatureType featureType = schema.getFeatureType( ftMapping.getFeatureType() ); Feature f = featureType.newFeature( id.getRid(), props, null ); mgr.updateFeature( f, ftMapping, analysis.getIdKernels(), mapping, replacement ); } }
@Override public FeatureInputStream query( Query query ) throws FeatureStoreException, FilterEvaluationException { if ( query.getTypeNames() == null || query.getTypeNames().length > 1 ) { String msg = "Join queries between multiple feature types are not by SQLFeatureStore (yet)."; throw new UnsupportedOperationException( msg ); } FeatureInputStream result = null; Filter filter = query.getFilter(); if ( query.getTypeNames().length == 1 && ( filter == null || filter instanceof OperatorFilter ) ) { QName ftName = query.getTypeNames()[0].getFeatureTypeName(); FeatureType ft = getSchema().getFeatureType( ftName ); if ( ft == null ) { String msg = "Feature store is not configured to serve feature type '" + ftName + "'."; throw new FeatureStoreException( msg ); } result = queryByOperatorFilter( query, ftName, (OperatorFilter) filter ); } else { // must be an id filter based query if ( query.getFilter() == null || !( query.getFilter() instanceof IdFilter ) ) { String msg = "Invalid query. If no type names are specified, it must contain an IdFilter."; throw new FilterEvaluationException( msg ); } result = queryByIdFilter( query.getTypeNames(), (IdFilter) filter, query.getSortProperties() ); } return result; }
@Override public int queryHits( Query query ) throws FeatureStoreException, FilterEvaluationException { if ( query.getTypeNames() == null || query.getTypeNames().length > 1 ) { String msg = "Join queries between multiple feature types are not supported by the SQLFeatureStore implementation (yet)."; throw new UnsupportedOperationException( msg ); } Filter filter = query.getFilter(); int hits = 0; if ( query.getTypeNames().length == 1 && ( filter == null || filter instanceof OperatorFilter ) ) { QName ftName = query.getTypeNames()[0].getFeatureTypeName(); FeatureType ft = getSchema().getFeatureType( ftName ); if ( ft == null ) { String msg = "Feature type '" + ftName + "' is not served by this feature store."; throw new FeatureStoreException( msg ); } hits = queryHitsByOperatorFilter( query, ftName, (OperatorFilter) filter ); } else { // must be an id filter based query if ( query.getFilter() == null || !( query.getFilter() instanceof IdFilter ) ) { String msg = "Invalid query. If no type names are specified, it must contain an IdFilter."; throw new FilterEvaluationException( msg ); } // should be no problem iterating over the features (id queries usually request only a few ids) hits = queryByIdFilter( query.getTypeNames(), (IdFilter) filter, query.getSortProperties() ).count(); } return hits; }