@Override public boolean isMapped( QName ftName ) { return schema.getFeatureType( ftName ) != null; }
List<Query> buildInfoQueries() { List<Query> queries = new ArrayList<Query>(); if ( ftName == null ) { queries.addAll( map( featureStore.getSchema().getFeatureTypes( null, false, false ), new Mapper<Query, FeatureType>() { @Override public Query apply( FeatureType u ) { Filter f; if ( filter == null ) { f = buildFilter( null, u, bbox ); } else { f = buildFilter( ( (OperatorFilter) filter ).getOperator(), u, bbox ); } return createQuery( u.getName(), f, -1, query.getFeatureCount(), -1, sortBy ); } } ) ); clearNulls( queries ); } else { Filter f; if ( filter == null ) { f = buildFilter( null, featureStore.getSchema().getFeatureType( ftName ), bbox ); } else { f = buildFilter( ( (OperatorFilter) filter ).getOperator(), featureStore.getSchema().getFeatureType( ftName ), bbox ); } queries.add( createQuery( ftName, f, -1, query.getFeatureCount(), -1, sortBy ) ); } return queries; }
@Override public boolean isMapped( QName ftName ) { return schema.getFeatureType( ftName ) != null; }
md.setMetadataId( lay.getMetadataSetId() ); if ( featureType != null ) { md.getFeatureTypes().add( store.getSchema().getFeatureType( featureType ) ); } else { md.getFeatureTypes().addAll( Arrays.asList( store.getSchema().getFeatureTypes() ) );
@Override public boolean isMapped( QName ftName ) { return schema.getFeatureType( ftName ) != null; }
@Override public boolean isMapped( QName ftName ) { return appSchema.getFeatureType( ftName ) != null; }
/** * Returns the {@link Envelope} for the stored features of the specified type. * * @param ftName * feature type name, must not be <code>null</code> * @return envelope, can be <code>null</code> */ Envelope getEnvelope( QName ftName ) { return ftToFeatures.get( schema.getFeatureType( ftName ) ).getEnvelope(); }
private static FeatureCollectionType extractFcCollectionType( String url, GMLVersion version, QName elName ) { GMLAppSchemaReader schemaReader = null; try { schemaReader = new GMLAppSchemaReader( version, null, url ); } catch ( Exception e ) { LOG.error( e.getMessage(), e ); } return (FeatureCollectionType) schemaReader.extractAppSchema().getFeatureType( elName ); }
@Override public Envelope calcEnvelope( QName ftName ) { Envelope ftEnv = null; FeatureType ft = schema.getFeatureType( ftName ); if ( ft != null ) { FeatureCollection fc = storedFeatures.getFeatures( ft ); if ( fc != null ) { ftEnv = fc.getEnvelope(); } } return ftEnv; }
+ schemaLoc ); FeatureType buildingType = schema.getFeatureType( QName.valueOf( NS_BRACE + "Building" ) ); if ( buildingType == null ) { throw new IllegalArgumentException( "Could not create a featuretype: " + NS_BRACE
protected boolean localReferencesPossible( QueryAnalyzer analyzer, int traverseXLinkDepth ) { if ( traverseXLinkDepth == 0 && analyzer.getQueries().size() == 1 ) { List<Query> queries = analyzer.getQueries().values().iterator().next(); if ( queries.size() == 1 ) { Query query = queries.get( 0 ); if ( query.getTypeNames().length == 1 ) { TypeName typeName = query.getTypeNames()[0]; FeatureStore fs = analyzer.getQueries().keySet().iterator().next(); FeatureType ft = fs.getSchema().getFeatureType( typeName.getFeatureTypeName() ); for ( PropertyType pt : ft.getPropertyDeclarations() ) { if ( pt instanceof FeaturePropertyType ) { FeaturePropertyType fpt = (FeaturePropertyType) pt; FeatureType targetFt = fpt.getValueFt(); if ( targetFt == null || fs.getSchema().isSubType( targetFt, ft ) ) { return true; } } } LOG.debug( "Forward references can be ruled out." ); return false; } } } return true; }
/** * Returns the deegree model representation for the GML object element event that the cursor of the underlying xml * stream points to. * * @return deegree model representation for the current GML object element, never <code>null</code> * @throws XMLStreamException * @throws UnknownCRSException * @throws XMLParsingException */ public GMLObject read() throws XMLStreamException, XMLParsingException, UnknownCRSException { GMLObject object = null; QName elName = xmlStream.getName(); if ( schema != null && schema.getFeatureType( elName ) != null ) { object = readFeature(); } else { // TODO object = readGeometry(); } return object; }
/** * Returns the feature type with the given name. * <p> * If no feature type with the given name is defined, an XMLParsingException is thrown. * * @param xmlStreamReader * * @param ftName * feature type name to look up * @return the feature type with the given name * @throws XMLParsingException * if no feature type with the given name is defined */ private FeatureType lookupFeatureType( XMLStreamReaderWrapper xmlStreamReader, QName ftName, boolean exception ) throws XMLParsingException { FeatureType ft = null; ft = schema.getFeatureType( ftName ); if ( ft == null ) { ft = WellKnownGMLTypes.getType( ftName ); } if ( ft == null && exception ) { String msg = Messages.getMessage( "ERROR_SCHEMA_FEATURE_TYPE_UNKNOWN", ftName ); throw new XMLParsingException( xmlStreamReader, msg ); } return ft; }
/** * Returns the feature type with the given name. * <p> * If no feature type with the given name is defined, an XMLParsingException is thrown. * * @param xmlStreamReader * * @param ftName * feature type name to look up * @return the feature type with the given name * @throws XMLParsingException * if no feature type with the given name is defined */ private FeatureType lookupFeatureType( XMLStreamReaderWrapper xmlStreamReader, QName ftName, boolean exception ) throws XMLParsingException { FeatureType ft = null; ft = schema.getFeatureType( ftName ); if ( ft == null ) { ft = WellKnownGMLTypes.getType( ftName ); } if ( ft == null && exception ) { String msg = Messages.getMessage( "ERROR_SCHEMA_FEATURE_TYPE_UNKNOWN", ftName ); throw new XMLParsingException( xmlStreamReader, msg ); } return ft; }
private TypedObjectNode parseComplexXMLElement( XMLStreamReaderWrapper xmlStream, ICRS crs ) throws NoSuchElementException, XMLStreamException, XMLParsingException, UnknownCRSException { QName elName = xmlStream.getName(); LOG.debug( "Parsing complex XML element " + elName + " (without schema information)" ); if ( gmlStreamReader.getGeometryReader().isGeometryElement( xmlStream ) ) { return gmlStreamReader.getGeometryReader().parse( xmlStream ); } else if ( schema.getFeatureType( elName ) != null ) { return gmlStreamReader.getFeatureReader().parseFeature( xmlStream, crs ); } Map<QName, PrimitiveValue> attrs = parseAttributes( xmlStream ); List<TypedObjectNode> children = new ArrayList<TypedObjectNode>(); int eventType = 0; while ( ( eventType = xmlStream.next() ) != END_ELEMENT ) { if ( eventType == START_ELEMENT ) { TypedObjectNode child = parseGenericXMLElement( xmlStream, null, crs ); children.add( child ); } else if ( eventType == CDATA || eventType == CHARACTERS ) { // mixed content -> use string as primitive type String s = xmlStream.getText(); if ( !s.trim().isEmpty() ) { children.add( new PrimitiveValue( s ) ); } } } return new GenericXMLElement( xmlStream.getName(), null, attrs, children ); }
if ( ftName != null && featureStore.getSchema().getFeatureType( ftName ) == null ) { LOG.warn( "FeatureType '" + ftName + "' is not known to the FeatureStore." ); return null;
} else { LOG.debug( "Detected complex non-geometry property '" + propName + "'. Treating as feature property." ); FeatureType valueFt = schema.getFeatureType( childElName ); if ( valueFt == null ) { valueFt = appSchema.addFeatureType( childElName );
if ( query.getTypeNames().length == 1 ) { QName ftName = query.getTypeNames()[0].getFeatureTypeName(); FeatureType ft = schema.getFeatureType( ftName ); if ( ft == null ) { String msg = "Feature type '" + ftName + "' is not served by this feature store.";
FeatureType ft = fs.getSchema().getFeatureType( ftName ); if ( ft == null ) { throw new FeatureStoreException( getMessage( "TA_OPERATION_FT_NOT_SERVED", ftName ) );
FeatureType ft = fs.getSchema().getFeatureType( ftName ); if ( ft == null ) { throw new FeatureStoreException( getMessage( "TA_OPERATION_FT_NOT_SERVED", ftName ) );