Stefano, Thanks for the quick response. Please see my comments in blue.
1) You're mapping a geometry (aixm:Surface) as a feature You are right. I know the mapping is a bit strange. As you can see from AIXM schema, an AirspaceVolume can have multiple Surfaces, So I think it might be good to use feature chaining and treat Surface as a feature or non-feature. 2) You're mapping the horizontalProjection property as a multi-valued property (<isMultiple>true</isMultiple>), but it's not Will correct this. 3) I was expecting a foreign key column in the GPS table, pointing to the G table: where is it? Is it true that g.id<http://g.id> = gps.id<http://gps.id>, as your mapping suggests? So gps.id<http://gps.id> is both primary key of the gps table and foreing key referencing g.id<http://g.id>? Yes. You are correct. 4) What type are the geometries stored in gps.longlat? The name of the column suggests you have points in there, but you're mapping it to a gml:LinearRing Points are stored in gps.longlat. 5) This thread<http://osgeo-org.1560.x6.nabble.com/App-schema-How-to-map-Oracle-Geometry-into-GML-td4984781.html> seems to confirm my doubts about types extending the base GML types (e.g. aixm:SurfaceType, which extends gml:SurfaceType): GeoServer uses statically defined Java bindings for all geometry types, so it is not comfortable with user-defined geometry types Do you have any suggestions about this? And on AIXM mapping? Thank you so much! Wen From: Stefano Costa [mailto:stefano.co...@geo-solutions.it] Sent: Monday, September 14, 2015 3:39 PM To: Yin, Wentao (IS) (Contr) Cc: geoserver-users Subject: Re: EXT :Re: [Geoserver-users] BBOX filter on chained features Hi Wen, please stay on the ML. Your mapping looks a bit strange (at least to me): 1) You're mapping a geometry (aixm:Surface) as a feature 2) You're mapping the horizontalProjection property as a multi-valued property (<isMultiple>true</isMultiple>), but it's not 3) I was expecting a foreign key column in the GPS table, pointing to the G table: where is it? Is it true that g.id<http://g.id> = gps.id<http://gps.id>, as your mapping suggests? So gps.id<http://gps.id> is both primary key of the gps table and foreing key referencing g.id<http://g.id>? 4) What type are the geometries stored in gps.longlat? The name of the column suggests you have points in there, but you're mapping it to a gml:LinearRing 5) This thread<http://osgeo-org.1560.x6.nabble.com/App-schema-How-to-map-Oracle-Geometry-into-GML-td4984781.html> seems to confirm my doubts about types extending the base GML types (e.g. aixm:SurfaceType, which extends gml:SurfaceType): GeoServer uses statically defined Java bindings for all geometry types, so it is not comfortable with user-defined geometry types On Mon, Sep 14, 2015 at 2:46 PM, Yin, Wentao (IS) (Contr) <wentao....@ngc.com<mailto:wentao....@ngc.com>> wrote: Thanks, Stefano, I can do BBOX query on surface if I make it a feature, but always got the error when query on it as a nested feature. The query I am using: <?xml version="1.0" encoding="UTF-8"?> <GetFeature service="WFS" version="2.0.0" xmlns="http://www.opengis.net/wfs/2.0" xmlns:aixm="http://www.aixm.aero/schema/5.1" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd "> <Query typeNames="aixm:AirspaceVolume"> <fes:Filter> <fes:BBOX> <fes:ValueReference> aixm:horizontalProjection/aixm:Surface/gml:polygonPatches/gml:PolygonPatch/gml:exterior/gml:LinearRing</fes:ValueReference> <gml:Envelope> <gml:lowerCorner>33.49 -99</gml:lowerCorner> <gml:upperCorner>55.59 -78</gml:upperCorner> </gml:Envelope> </fes:BBOX> </fes:Filter> </Query> </GetFeature> The error: <ows:ExceptionReport version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://localhost:8080/geoserver/schemas/ows/1.1.0/owsAll.xsd"><ows:Exception exceptionCode="NoApplicableCode"><ows:ExceptionText>java.lang.RuntimeException: java.io.IOException java.io.IOExceptionExpecting a feature to apply filter, but found: SimpleFeatureTypeImpl G identified extends Feature(ID:ID,NAME:NAME)</ows:ExceptionText></ows:Exception></ows:ExceptionReport> Here are the mapping files: Aixm_Surface.xml: <?xml version="1.0" encoding="UTF-8"?> <as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.geotools.org/app-schema AppSchemaDataAccess.xsd"> <namespaces> <Namespace> <prefix>gml</prefix> <uri>http://www.opengis.net/gml/3.2</uri> </Namespace> <Namespace> <prefix>aixm</prefix> <uri>http://www.aixm.aero/schema/5.1</uri> </Namespace> </namespaces> <sourceDataStores> <DataStore> <id>datastore</id> <parameters> <Parameter> <name>dbtype</name> <value>Oracle</value> </Parameter> <Parameter> <name>host</name> <value>localhost</value> </Parameter> <Parameter> <name>port</name> <value>1521</value> </Parameter> <Parameter> <name>database</name> <value>XE</value> </Parameter> <Parameter> <name>user</name> <value>testdb</value> </Parameter> <Parameter> <name>passwd</name> <value>123</value> </Parameter> <Parameter> <name>Expose primary keys</name> <value>true</value> </Parameter> </parameters> </DataStore> </sourceDataStores> <targetTypes> <FeatureType> <schemaUri>http://www.aixm.aero/gallery/content/public/schema/5.1/AIXM_Features.xsd</schemaUri> </FeatureType> </targetTypes> <typeMappings> <FeatureTypeMapping> <mappingName>aixm_surface</mappingName> <sourceDataStore>datastore</sourceDataStore> <sourceType>GPS</sourceType> <targetElement>aixm:Surface</targetElement> <attributeMappings> <AttributeMapping> <targetAttribute> aixm:Surface </targetAttribute> <idExpression> <OCQL>ID</OCQL> </idExpression> </AttributeMapping> <AttributeMapping> <targetAttribute> gml:polygonPatches/gml:PolygonPatch/gml:exterior/gml:LinearRing </targetAttribute> <sourceExpression> <OCQL>LONGLAT</OCQL> </sourceExpression> </AttributeMapping> <AttributeMapping> <targetAttribute> FEATURE_LINK </targetAttribute> <sourceExpression> <OCQL>ID</OCQL> </sourceExpression> </AttributeMapping> </attributeMappings> </FeatureTypeMapping> </typeMappings> </as:AppSchemaDataAccess> Aixm_AirspaceVoume.xml: <?xml version="1.0" encoding="UTF-8"?> <as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.geotools.org/app-schema AppSchemaDataAccess.xsd"> <namespaces> <Namespace> <prefix>gml</prefix> <uri>http://www.opengis.net/gml/3.2</uri> </Namespace> <Namespace> <prefix>aixm</prefix> <uri>http://www.aixm.aero/schema/5.1</uri> </Namespace> </namespaces> <sourceDataStores> <DataStore> <id>datastore</id> <parameters> <Parameter> <name>dbtype</name> <value>Oracle</value> </Parameter> <Parameter> <name>host</name> <value>localhost</value> </Parameter> <Parameter> <name>port</name> <value>1521</value> </Parameter> <Parameter> <name>database</name> <value>XE</value> </Parameter> <Parameter> <name>user</name> <value>testdb</value> </Parameter> <Parameter> <name>passwd</name> <value>123</value> </Parameter> <Parameter> <name>Expose primary keys</name> <value>true</value> </Parameter> </parameters> </DataStore> </sourceDataStores> <targetTypes> <FeatureType> <schemaUri>http://www.aixm.aero/gallery/content/public/schema/5.1/AIXM_Features.xsd</schemaUri> </FeatureType> </targetTypes> <typeMappings> <FeatureTypeMapping> <mappingName>aixm_AirspaceVolume</mappingName> <sourceDataStore>datastore</sourceDataStore> <sourceType>G</sourceType> <targetElement>aixm:AirspaceVolume</targetElement> <attributeMappings> <AttributeMapping> <targetAttribute> aixm:AirspaceVolume </targetAttribute> <idExpression> <OCQL>ID</OCQL> </idExpression> </AttributeMapping> <AttributeMapping> <targetAttribute> aixm:horizontalProjection </targetAttribute> <sourceExpression> <OCQL>ID</OCQL> <linkElement>aixm_surface</linkElement> <linkField>FEATURE_LINK</linkField> </sourceExpression> <isMultiple>true</isMultiple> </AttributeMapping> </attributeMappings> </FeatureTypeMapping> </typeMappings> </as:AppSchemaDataAccess> CREATE TABLE gps (id INT, longlat MDSYS.SDO_GEOMETRY); CREATE TABLE g (id INT, name VARCHAR2(10)); Thanks again for help! Wen
------------------------------------------------------------------------------
_______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users