[mapserver-dev] Ticket #3042 - Problem with OGC Filter FEATUREID and WFS with type ORACLESPATIAL

Michael Smith michael.smith at usace.army.mil
Thu Jun 4 21:31:37 EDT 2009


This is Ticket #3042

When querying an Oracle Spatial layer using WFS and passing a FEATUREID
filter, the constructed sql query is missing parens around the collected OR
predicates. It is missing 2 opening parens and the closing parens before the
SDO_FILTER part and there is a quote character outside the last parens when
it should be inside.

This looks to be in mapogcfilter.c

example call: 

http://localhost/cgi-bin/mapserv?map=cm2_dev/cm2_watwms.map&SERVICE=WFS&VERS
ION=1.0.0&REQUEST=GetFeature&FEATUREID=usgsgages.7759,usgsgages.7760,usgsgag
es.7761,usgsgages.7762,usgsgages.7792,usgsgages.7794,usgsgages.7795,usgsgage
s.7796,usgsgages.7797,usgsgages.7810,usgsgages.7811,usgsgages.7812&TYPENAME=
usgsgages

returns

<ServiceExceptionReport version="1.2.0"
xsi:schemaLocation="http://www.opengis.net/ogc
http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
<ServiceException code="NoApplicableCode" locator="mapserv">
msWFSGetFeature: WFS server error. FLTApplyFilterToLayer() failed
msOracleSpatialLayerWhichShapes(): OracleSpatial error. Error: ORA-00933:
SQL command not properly ended

Query statement: SELECT objectid, PERCENTILE, SHAPE FROM METAR.USGS_REALSTX
WHERE  objectid = '7759') OR (objectid = '7760') OR (objectid = '7761') OR
(objectid = '7762') OR (objectid = '7792') OR (objectid = '7794') OR
(objectid = '7795') OR (objectid = '7796') OR (objectid = '7797') OR
(objectid = '7810') OR (objectid = '7811') OR (objectid = '7812)'  AND
SDO_FILTER( SHAPE, MDSYS.SDO_GEOMETRY(2003, 8265,
NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),MDSYS.SDO_ORDINATE_ARRAY(-177.47,13
.43,-64.71,72.55) ),'querytype=window') = 'TRUE' . Check your data
statement.

</ServiceException>
</ServiceExceptionReport>


-- 
Michael Smith
RSGIS Center
ERDC - CRREL
US Army Corps of Engineers




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20090604/de66ad7c/attachment-0001.html


More information about the mapserver-dev mailing list