[Geoserver-users] WFS GetFeature request fails in GeoServer 1.6.3 with Oracle plugin because of missing SRID in SQL query

Hi list,

I am trying to upgrade our GeoServer 1.5.4 installation to GeoServer 1.6.3. Our data are stored in an Oracle 10G database, so we are using the GeoServer Oracle plugin. The following WFS GetFeature request works fine in 1.5.4:

<wfs:GetFeature service=“WFS” version=“1.0.0” maxFeatures=“15” outputFormat=“GML2” xmlns:wfs=“http://www.opengis.net/wfs”>

<wfs:Query typeName=“limosa:VERENIGING109”>
<ogc:Filter xmlns:gml='http://www.opengis.net/gml’ xmlns:ogc='http://www.opengis.net/ogc’>
ogc:Intersects
ogc:PropertyNamelimosa:THE_GEOM</ogc:PropertyName>
<gml:Point srsName=“http://www.opengis.net/gml/srs/epsg.xml#28992”>
gml:coordinates185799.16932457592,575243.5864312415</gml:coordinates>
</gml:Point>
</ogc:Intersects>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

However, in 1.6.3, it fails with the following ServiceException:

error:Translator error
Translator error
Error reading Features
Could not aquire feature:org.geotools.data.DataSourceException: Error Performing SQL query: SELECT “ID”, “BEHEER”, “TOESTANDP1”, “TOESTANDP2”, “TOESTANDP3”, “TOESTANDP4”, “TOESTANDP5”, “TOESTANDP6”, “THE_GEOM” FROM “VERENIGING109” WHERE SDO_RELATE(“THE_GEOM”,MDSYS.SDO_GEOMETRY(2001,NULL,MDSYS.SDO_POINT_TYPE(185592.16031008327,575211.241272727,NULL),NULL,NULL),‘mask=anyinteract querytype=WINDOW’) = ‘TRUE’

Error Performing SQL query: SELECT “ID”, “BEHEER”, “TOESTANDP1”, “TOESTANDP2”, “TOESTANDP3”, “TOESTANDP4”, “TOESTANDP5”, “TOESTANDP6”, “THE_GEOM” FROM “VERENIGING109” WHERE SDO_RELATE(“THE_GEOM”,MDSYS.SDO_GEOMETRY(2001,NULL,MDSYS.SDO_POINT_TYPE(185592.16031008327,575211.241272727,NULL),NULL,NULL),‘mask=anyinteract querytype=WINDOW’) = ‘TRUE’

ORA-29902: error in executing ODCIIndexStart() routine
ORA-13208: internal error while evaluating [window SRID does not match layer SRID] operator
ORA-06512: at “MDSYS.SDO_INDEX_METHOD_10I”, line 286

Apparently, the SRID (28992, the Dutch national grid), gets lost somewhere between the WFS GetFeatureRequest and the SQL query in the Oracle Spatial plugin. If I modify the SQL statement to include the SRS code and then execute the query manually, the SQL statement returns the right feature.

If I update the user_sdo_geom_metadata table and set srid to null, the WFS GetFeature request returns the right feature as well, probably since window SRID (null) and layer SRID (also null) do match now. However, if I set SRID to null, the layer is no longer displayed when doing a WMS GetMap request for instance.

The problem seems similar to the one described here: http://www.nabble.com/WFS-T—Oracle-question-td16615276.html#a16615276. I have created a table as described in this post, to no avail. How can I make sure the SRID is inserted into the SQL select statement? Hopefully anyone can point me in the right direction.

We are using GeoServer 1.6.3 with gt2-oracle-spatial-2.4.2.jar and ojdbc14.jar, Tomcat 5.5 on Windows XP. The version of the Oracle database is 10.2.0.1.0.

Kind regards,

Bas Vanmeulebrouk.

Hmmm... Could you try:

<wfs:GetFeature service="WFS" version="1.0.0" maxFeatures="15" outputFormat="GML2" xmlns:wfs="http://www.opengis.net/wfs&quot;&gt;

<wfs:Query typeName="limosa:VERENIGING109" srsName="28992">
<ogc:Filter xmlns:gml='http://www.opengis.net/gml’ xmlns:ogc='http://www.opengis.net/ogc’>
<ogc:Intersects>
<ogc:PropertyName>limosa:THE_GEOM</ogc:PropertyName>
<gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#28992&quot;&gt;
<gml:coordinates>185799.16932457592,575243.5864312415</gml:coordinates>
</gml:Point>
</ogc:Intersects>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

It adds in srsName="28992".

See http://geoserver.org/display/GEOSDOC/WFS+vendor+parameters#WFSvendorparameters-WFS1.0reprojection

And you could do it with a WFS 1.1 request, where you explicitly set the srs stuff in the request.

best regards,

Chris

Vanmeulebrouk, Bas wrote:

Hi list,

I am trying to upgrade our GeoServer 1.5.4 installation to GeoServer 1.6.3. Our data are stored in an Oracle 10G database, so we are using the GeoServer Oracle plugin. The following WFS GetFeature request works fine in 1.5.4:

<wfs:GetFeature service="WFS" version="1.0.0" maxFeatures="15" outputFormat="GML2" xmlns:wfs="http://www.opengis.net/wfs&quot;&gt;

<wfs:Query typeName="limosa:VERENIGING109">
<ogc:Filter xmlns:gml='http://www.opengis.net/gml’ xmlns:ogc='http://www.opengis.net/ogc’>
<ogc:Intersects>
<ogc:PropertyName>limosa:THE_GEOM</ogc:PropertyName>
<gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#28992&quot;&gt;
<gml:coordinates>185799.16932457592,575243.5864312415</gml:coordinates>
</gml:Point>
</ogc:Intersects>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

However, in 1.6.3, it fails with the following ServiceException:

<ServiceExceptionReport version="1.2.0" xsi:schemaLocation="http://www.opengis.net/ogc _http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd_&quot; xmlns="http://www.opengis.net/ogc&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;

  <ServiceException>error:Translator error
Translator error
Error reading Features
Could not aquire feature:org.geotools.data.DataSourceException: Error Performing SQL query: SELECT "ID", "BEHEER", "TOESTANDP1", "TOESTANDP2", "TOESTANDP3", "TOESTANDP4", "TOESTANDP5", "TOESTANDP6", "THE_GEOM" FROM "VERENIGING109" WHERE SDO_RELATE("THE_GEOM",MDSYS.SDO_GEOMETRY(2001,NULL,MDSYS.SDO_POINT_TYPE(185592.16031008327,575211.241272727,NULL),NULL,NULL),'mask=anyinteract querytype=WINDOW') = 'TRUE'

Error Performing SQL query: SELECT "ID", "BEHEER", "TOESTANDP1", "TOESTANDP2", "TOESTANDP3", "TOESTANDP4", "TOESTANDP5", "TOESTANDP6", "THE_GEOM" FROM "VERENIGING109" WHERE SDO_RELATE("THE_GEOM",MDSYS.SDO_GEOMETRY(2001,NULL,MDSYS.SDO_POINT_TYPE(185592.16031008327,575211.241272727,NULL),NULL,NULL),'mask=anyinteract querytype=WINDOW') = 'TRUE'

ORA-29902: error in executing ODCIIndexStart() routine
ORA-13208: internal error while evaluating [window SRID does not match layer SRID] operator
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 286</ServiceException>
</ServiceExceptionReport>

Apparently, the SRID (28992, the Dutch national grid), gets lost somewhere between the WFS GetFeatureRequest and the SQL query in the Oracle Spatial plugin. If I modify the SQL statement to include the SRS code and then execute the query manually, the SQL statement returns the right feature.

If I update the user_sdo_geom_metadata table and set srid to null, the WFS GetFeature request returns the right feature as well, probably since window SRID (null) and layer SRID (also null) do match now. However, if I set SRID to null, the layer is no longer displayed when doing a WMS GetMap request for instance.

The problem seems similar to the one described here: _http://www.nabble.com/WFS-T---Oracle-question-td16615276.html#a16615276_. I have created a table as described in this post, to no avail. How can I make sure the SRID is inserted into the SQL select statement? Hopefully anyone can point me in the right direction.

We are using GeoServer 1.6.3 with gt2-oracle-spatial-2.4.2.jar and ojdbc14.jar, Tomcat 5.5 on Windows XP. The version of the Oracle database is 10.2.0.1.0.

Kind regards,

Bas Vanmeulebrouk.

!DSPAM:4005,48172f6d4521012714783!

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

!DSPAM:4005,48172f6d4521012714783!

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4005,48172f6d4521012714783!

Hi Chris, list,

Thank you very much for your answer. I have tried adding EPSG:28992 to
the WFS 1.0 query. Unfortunately, the query still fails with same error
(window SRID does not match layer SRID). A WFS 1.1 quey fails as well. I
have tried the query against a shapefile datastore with the same data,
and it runs fine, both with and without the srsName attribute in the
query. Which led me to believe the problem is somewhere in the Oracle
part of our configuration.

Kind regards,

Bas.

-----Original Message-----
From: Chris Holmes [mailto:cholmes@anonymised.com]
Sent: woensdag 30 april 2008 14:05
To: Vanmeulebrouk, Bas
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] WFS GetFeature request fails in GeoServer
1.6.3 with Oracle plugin because of missing SRID in SQL query

Hmmm... Could you try:

<wfs:GetFeature service="WFS" version="1.0.0" maxFeatures="15"
outputFormat="GML2" xmlns:wfs="http://www.opengis.net/wfs&quot;&gt;

<wfs:Query typeName="limosa:VERENIGING109" srsName="28992"> <ogc:Filter
xmlns:gml='http://www.opengis.net/gml
xmlns:ogc='http://www.opengis.net/ogc’>
<ogc:Intersects>
<ogc:PropertyName>limosa:THE_GEOM</ogc:PropertyName>
<gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#28992&quot;&gt;
<gml:coordinates>185799.16932457592,575243.5864312415</gml:coordinates>
</gml:Point>
</ogc:Intersects>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

It adds in srsName="28992".

See
http://geoserver.org/display/GEOSDOC/WFS+vendor+parameters#WFSvendorpara
meters-WFS1.0reprojection

And you could do it with a WFS 1.1 request, where you explicitly set the
srs stuff in the request.

best regards,

Chris

Vanmeulebrouk, Bas wrote:

Hi list,

I am trying to upgrade our GeoServer 1.5.4 installation to GeoServer
1.6.3. Our data are stored in an Oracle 10G database, so we are using
the GeoServer Oracle plugin. The following WFS GetFeature request
works fine in 1.5.4:

<wfs:GetFeature service="WFS" version="1.0.0" maxFeatures="15"
outputFormat="GML2" xmlns:wfs="http://www.opengis.net/wfs&quot;&gt;

<wfs:Query typeName="limosa:VERENIGING109"> <ogc:Filter
xmlns:gml='http://www.opengis.net/gml
xmlns:ogc='http://www.opengis.net/ogc’>
<ogc:Intersects>
<ogc:PropertyName>limosa:THE_GEOM</ogc:PropertyName>
<gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#28992&quot;&gt;
<gml:coordinates>185799.16932457592,575243.5864312415</gml:coordinates
>
</gml:Point>
</ogc:Intersects>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

However, in 1.6.3, it fails with the following ServiceException:

<ServiceExceptionReport version="1.2.0"
xsi:schemaLocation="http://www.opengis.net/ogc
_http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd_&quot;
xmlns="http://www.opengis.net/ogc&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;

  <ServiceException>error:Translator error Translator error Error
reading Features Could not aquire
feature:org.geotools.data.DataSourceException: Error Performing SQL
query: SELECT "ID", "BEHEER", "TOESTANDP1", "TOESTANDP2",
"TOESTANDP3", "TOESTANDP4", "TOESTANDP5", "TOESTANDP6", "THE_GEOM"
FROM "VERENIGING109" WHERE
SDO_RELATE("THE_GEOM",MDSYS.SDO_GEOMETRY(2001,NULL,MDSYS.SDO_POINT_TYP
E(185592.16031008327,575211.241272727,NULL),NULL,NULL),'mask=anyintera
ct
querytype=WINDOW') = 'TRUE'

Error Performing SQL query: SELECT "ID", "BEHEER", "TOESTANDP1",
"TOESTANDP2", "TOESTANDP3", "TOESTANDP4", "TOESTANDP5", "TOESTANDP6",
"THE_GEOM" FROM "VERENIGING109" WHERE
SDO_RELATE("THE_GEOM",MDSYS.SDO_GEOMETRY(2001,NULL,MDSYS.SDO_POINT_TYP
E(185592.16031008327,575211.241272727,NULL),NULL,NULL),'mask=anyintera
ct
querytype=WINDOW') = 'TRUE'

ORA-29902: error in executing ODCIIndexStart() routine
ORA-13208: internal error while evaluating [window SRID does not
match layer SRID] operator
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line
286</ServiceException> </ServiceExceptionReport>

Apparently, the SRID (28992, the Dutch national grid), gets lost
somewhere between the WFS GetFeatureRequest and the SQL query in the
Oracle Spatial plugin. If I modify the SQL statement to include the
SRS code and then execute the query manually, the SQL statement
returns the right feature.

If I update the user_sdo_geom_metadata table and set srid to null, the

WFS GetFeature request returns the right feature as well, probably
since window SRID (null) and layer SRID (also null) do match now.
However, if I set SRID to null, the layer is no longer displayed when
doing a WMS GetMap request for instance.

The problem seems similar to the one described here:

_http://www.nabble.com/WFS-T---Oracle-question-td16615276.html#a16615276
_.

I have created a table as described in this post, to no avail. How can

I make sure the SRID is inserted into the SQL select statement?
Hopefully anyone can point me in the right direction.

We are using GeoServer 1.6.3 with gt2-oracle-spatial-2.4.2.jar and
ojdbc14.jar, Tomcat 5.5 on Windows XP. The version of the Oracle
database is 10.2.0.1.0.

Kind regards,

Bas Vanmeulebrouk.

!DSPAM:4005,48172f6d4521012714783!

----------------------------------------------------------------------
--

----------------------------------------------------------------------
--- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save

$100.

Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com
/javaone

!DSPAM:4005,48172f6d4521012714783!

----------------------------------------------------------------------
--

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4005,48172f6d4521012714783!