Hi,
Geoserver tries to execute an invalid SQL query against Oracle Spatial
10r2 when I try to fetch a feature from a layer that originates from a
view (not table). In this case, the query is as follows:
SELECT "OID", "MY_GEOM" FROM "VW_TEST" WHERE ()
"WHERE ()" is the problem.
My view is as follows:
SQL> desc vw_test;
Name Null? Type
----------------------------------------- -------- ----------------------------
OID NOT NULL NUMBER(10)
MY_GEOM MDSYS.SDO_GEOMETRY
OID comes from a column that is the primary key in the original table.
The view is listed in USER_SDO_GEOM_METADATA. SRID is NULL, but I've
declared it in Geoserver configuration.
WFS DescribeFeatureType for this layer returns:
<?xml version="1.0" encoding="UTF-8"?><xs:schema
targetNamespace="http://www.example.org"
xmlns:example="http://www.example.org"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified"
version="1.0"><xs:import namespace="http://www.opengis.net/gml"
schemaLocation="http://localhost:8080/geoserver/schemas/gml/2.1.2.1/feature.xsd"/><xs:complexType
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/2001/XMLSchema" name="VW_TEST_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="OID" minOccurs="1" nillable="false" type="xs:decimal"/>
<xs:element name="MY_GEOM" minOccurs="0" nillable="true"
type="gml:GeometryAssociationType"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="VW_TEST" type="example:VW_TEST_Type"
substitutionGroup="gml:_Feature"/></xs:schema>
It lists OID as an attribute. Is this correct? It is not treated as a
unique identifier of the feature, right?
The client (uDig), now invents interesting FID values, like
VW_TEST.nfm--408ac6b7_11b0caefb1c_-5b03, as in the following WFS
request it sends:
<?xml version="1.0" encoding="UTF-8"?>
<GetFeature xmlns="http://www.opengis.net/wfs"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc" version="1.0.0" service="WFS"
outputFormat="GML2"><Query handle="liteRenderer"
typeName="example:VW_TEST"><ogc:PropertyName>MY_GEOM</ogc:PropertyName>
<ogc:Filter><ogc:FeatureId fid="VW_TEST.nfm--408ac6b7_11b0caefb1c_-5b03"/>
</ogc:Filter>
</Query>
</GetFeature>
That causes Geoserver to fail:
<?xml version="1.0" ?>
<ServiceExceptionReport
version="1.2.0"
xmlns="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/ogc
http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
<ServiceException>
error:Translator error
Translator error
Error reading Features
Could not aquire feature:org.geotools.data.DataSourceException: Error
Performing SQL query: SELECT "OID", "MY_GEOM" FROM "VW_TEST" WHERE ()
Error Performing SQL query: SELECT "OID", "MY_GEOM" FROM "VW_TEST" WHERE ()
ORA-00936: missing expression
</ServiceException></ServiceExceptionReport>
Geoserver and Oracle plugin are dated 2008-07-08 (trunk).
Have I overlooked something? Does this look like a problem with the
client, Geoserver or perhaps with GS Oracle Spatial plugin? Should I
expect Oracle Spatial views to work with Geoserver?