Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#2443 closed defect (fixed)

WFS 1.0.0 GetFeature when a bbox partially enclosed a feature shall return this feature

Reported by: nsavard Owned by: pramsey
Priority: normal Milestone: 5.2 release
Component: WFS Server Version: 5.0
Severity: normal Keywords: OGC, Cite, TEAM, WFS 1.0.0
Cc: tomkralidis, assefa, pramsey

Description

To be WFS 1.0.0 compliant the WFS server shall return the feature that is partially enclosed by a bbox in response to a GetFeature request. Right now it returns an exception (see below).


Response from server:

<ServiceExceptionReport 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/wms/1.1.1/OGC-exception.xsd">

<ServiceException>

msQueryByRect(): Search returned no results. No matching record(s) found.

</ServiceException>

</ServiceExceptionReport>


Request sent:

http://dev1.lan.mapgears.com/manwe/cgi-bin/mswfs100_ogc_cite?& service=WFS&version=1.0.0&request=GetFeature&typename=cgf:MPoints& filter=%3Cogc%3AFilter+xmlns%3Aogc%3D%22 http%3A%2F%2Fwww.opengis.net%2Fogc%22+xmlns%3Agml%3D%22 http%3A%2F%2Fwww.opengis.net%2Fgml%22%3E%3Cogc%3ABBOX%3E%3C ogc%3APropertyName%3Egml%3AmultiPointProperty%3C%2F ogc%3APropertyName%3E%3Cgml%3ABox+xmlns%3D%22 http%3A%2F%2Fwww.opengis.net%2Fcite%2FspatialTestSuite%22+ srsName%3D%22EPSG%3A32615%22%3E%3Cgml%3A coordinates%3E500375%2C500000+500400%2C500100%3C%2Fgml%3A coordinates%3E%3C%2Fgml%3ABox%3E%3C%2Fogc%3ABBOX%3E%3C%2F ogc%3AFilter%3E

Attachments (2)

mstrac2443_comment7.tgz (7.0 KB ) - added by nsavard 16 years ago.
This is the test case for comment:7
wfs-multipoint.patch (5.1 KB ) - added by pramsey 16 years ago.
Tentative fix

Download all attachments as: .zip

Change History (20)

comment:1 by dmorissette, 16 years ago

Milestone: 5.2 release

comment:2 by nsavard, 16 years ago

Keywords: OGC Cite TEAM WFS 1.0.0 added

comment:3 by tomkralidis, 16 years ago

Norm: I can't seem to reproduce this. Filter BBOX queries return features for partials on my test data here. Can you wrap up a small testcase and email to me?

comment:4 by tomkralidis, 16 years ago

Cc: tomkralidis assefa added

comment:5 by tomkralidis, 16 years ago

Norm: thanks for the testcase. Can you send along the underlying dataset in the request (i.e. MPoints)? The mapfile points to a postgis db for this one. Perhaps you can run pgsql2shp and pass me a shapefile for testing?

comment:6 by tomkralidis, 16 years ago

Norm: thanks for emailing the data as shapefiles. I tried this again and can't reproduce. Here's the altered testcase: http://devgeo.cciw.ca/ms_tmp/mstrac-2443.tgz (you'll see that I commented out SHAPEPATH in the mapfile). Run ./req to run the testcase per this ticket.

What does your table for this layer look like in !PostGIS? Can you do a \dt and post the output?

I can try to load in a database and see if the behaviour changes.

comment:7 by nsavard, 16 years ago

After further testing it comes out that there is a problem when the requested layer is a PostGIS one. It returns the correct result when the MPoints layer is a shapefile layer. The MPoints layer contains only two points located at: (500325 500025,500375 500075) and is a multipoint object. When the bbox of the request is set to: (500375,500000 500400,500100), MapServer does not find the multipoint object. I trapped the debug log for this case (see case 1 below). Notice that in this case only one request is sent to the PostGIS db.

When the bbox is set to (500325,500000 500400,500100), MapServer finds the object. The debug log appears below as case 2. Notice that there are two requests sent by MapServer in this case.

I'll attach a test case. Case 1: [Wed Mar 19 15:36:10 2008].765795 msPOSTGISLayerOpen called datastatement: multi pointproperty from mpoints using unique pkey using SRID=32615 [Wed Mar 19 15:36:10 2008].766264 MSPOSTGISLayerOpen -- shared connection not av ailable. [Wed Mar 19 15:36:10 2008].778640 msConnPoolRegister(MPoints,dbname=cite-wfs100, 0x80c2fb0) [Wed Mar 19 15:36:10 2008].778770 msPOSTGISLayerFreeItemInfo called [Wed Mar 19 15:36:10 2008].778837 msPOSTGISLayerWhichShapes called [Wed Mar 19 15:36:10 2008].778964 msPOSTGISLayerParseData: unique column = pkey,

srid='32615', geom_column_name = multipointproperty, table_name=mpoints

[Wed Mar 19 15:36:10 2008].779927 query_string_0_6:DECLARE mycursor BINARY CURSO R FOR SELECT asbinary(force_collection(force_2d(multipointproperty)),'NDR'),pkey ::text from mpoints WHERE multipointproperty && setSRID('BOX3D(500375 500000,500 400 500100)'::BOX3D, 32615 ) [Wed Mar 19 15:36:10 2008].824388 msPOSTGISLayerFreeItemInfo called [Wed Mar 19 15:36:10 2008].824460 msPOSTGISLayerClose datastatement: multipointp roperty from mpoints using unique pkey using SRID=32615 [Wed Mar 19 15:36:10 2008].824497 msPOSTGISLayerClose -- closing query_result [Wed Mar 19 15:36:10 2008].824834 msConnPoolRelease(MPoints,dbname=cite-wfs100,0 x80c2fb0) [Wed Mar 19 15:36:10 2008].824892 msConnPoolClose(dbname=cite-wfs100,0x80c2fb0) [Wed Mar 19 15:36:10 2008].827212 msQueryByRect(): Search returned no results. N o matching record(s) found. [Wed Mar 19 15:36:10 2008].827290 msWFSGetFeature(): WFS server error. FLTApplyF ilterToLayer() failed [Wed Mar 19 15:36:10 2008].829662 msFreeMap(): freeing map at 0x8098fc8. [Wed Mar 19 15:36:10 2008].829728 msPOSTGISLayerClose datastatement: multipointp roperty from mpoints using unique pkey using SRID=32615 [Wed Mar 19 15:36:10 2008].829767 msPOSTGISLayerClose -- layerinfo is NULL

Case 2:

[Wed Mar 19 15:36:15 2008].332703 msPOSTGISLayerOpen called datastatement: multi pointproperty from mpoints using unique pkey using SRID=32615 [Wed Mar 19 15:36:15 2008].333178 MSPOSTGISLayerOpen -- shared connection not av ailable. [Wed Mar 19 15:36:15 2008].345561 msConnPoolRegister(MPoints,dbname=cite-wfs100, 0x8eb0fb0) [Wed Mar 19 15:36:15 2008].345715 msPOSTGISLayerFreeItemInfo called [Wed Mar 19 15:36:15 2008].345786 msPOSTGISLayerWhichShapes called [Wed Mar 19 15:36:15 2008].345916 msPOSTGISLayerParseData: unique column = pkey,

srid='32615', geom_column_name = multipointproperty, table_name=mpoints

[Wed Mar 19 15:36:15 2008].346871 query_string_0_6:DECLARE mycursor BINARY CURSO R FOR SELECT asbinary(force_collection(force_2d(multipointproperty)),'NDR'),pkey ::text from mpoints WHERE multipointproperty && setSRID('BOX3D(500325 500000,500 400 500100)'::BOX3D, 32615 ) [Wed Mar 19 15:36:15 2008].393538 msPOSTGISLayerFreeItemInfo called [Wed Mar 19 15:36:15 2008].393610 msPOSTGISLayerClose datastatement: multipointp roperty from mpoints using unique pkey using SRID=32615 [Wed Mar 19 15:36:15 2008].393670 msPOSTGISLayerClose -- closing query_result [Wed Mar 19 15:36:15 2008].394012 msConnPoolRelease(MPoints,dbname=cite-wfs100,0 x8eb0fb0) [Wed Mar 19 15:36:15 2008].394070 msConnPoolClose(dbname=cite-wfs100,0x8eb0fb0) [Wed Mar 19 15:36:15 2008].449302 msPOSTGISLayerOpen called datastatement: multi pointproperty from mpoints using unique pkey using SRID=32615 [Wed Mar 19 15:36:15 2008].449376 MSPOSTGISLayerOpen -- shared connection not av ailable. [Wed Mar 19 15:36:15 2008].458435 msConnPoolRegister(MPoints,dbname=cite-wfs100, 0x8eb10e0) [Wed Mar 19 15:36:15 2008].458546 msPOSTGISLayerFreeItemInfo called [Wed Mar 19 15:36:15 2008].458585 in msPOSTGISLayerGetItems (find column names) [Wed Mar 19 15:36:15 2008].458666 msPOSTGISLayerParseData: unique column = pkey,

srid='32615', geom_column_name = multipointproperty, table_name=mpoints

[Wed Mar 19 15:36:15 2008].465759 msPOSTGISLayerInitItemInfo called [Wed Mar 19 15:36:15 2008].466009 msPOSTGISLayerGetShape called for record = 1 [Wed Mar 19 15:36:15 2008].466076 msPOSTGISLayerParseData: unique column = pkey,

srid='32615', geom_column_name = multipointproperty, table_name=mpoints

[Wed Mar 19 15:36:15 2008].466208 msPOSTGISLayerGetShape: DECLARE mycursor2 BINA RY CURSOR FOR SELECT "id"::text,"pkey"::text,asbinary(force_collection(force_2d( multipointproperty)),'NDR') from mpoints WHERE pkey = 1 [Wed Mar 19 15:36:15 2008].511557 msPOSTGISLayerFreeItemInfo called [Wed Mar 19 15:36:15 2008].511650 msPOSTGISLayerClose datastatement: multipointp roperty from mpoints using unique pkey using SRID=32615 [Wed Mar 19 15:36:15 2008].511689 msPOSTGISLayerClose -- query_result is NULL [Wed Mar 19 15:36:15 2008].511721 msConnPoolRelease(MPoints,dbname=cite-wfs100,0 x8eb10e0) [Wed Mar 19 15:36:15 2008].511761 msConnPoolClose(dbname=cite-wfs100,0x8eb10e0) [Wed Mar 19 15:36:15 2008].514338 msFreeMap(): freeing map at 0x8e86fc8. [Wed Mar 19 15:36:15 2008].514438 msPOSTGISLayerClose datastatement: multipointp roperty from mpoints using unique pkey using SRID=32615 [Wed Mar 19 15:36:15 2008].514478 msPOSTGISLayerClose -- layerinfo is NULL

by nsavard, 16 years ago

Attachment: mstrac2443_comment7.tgz added

This is the test case for comment:7

comment:8 by nsavard, 16 years ago

I made a formatting mistake when pasting the MapServer log output for the two cases in comment:7. Nevertheless you can find a copy of this output in the attachement, in the file named "output.log".

comment:9 by nsavard, 16 years ago

Cc: pramsey added

Paul: Can you have a look to this one because this is related to PostGis? The main problem is that the PostGis layers do not have the same behaviour as the shapefile layers when a bbox partially enclosed a feature.

comment:10 by pramsey, 16 years ago

Owner: changed from mapserverbugs to pramsey
Status: newassigned

OK, I have duplicated the test case behavior. I'll see if I can track down the root cause before rejecting the ticket as not worth fixing :)

comment:11 by pramsey, 16 years ago

Status: assignednew

comment:12 by pramsey, 16 years ago

Status: newassigned

by pramsey, 16 years ago

Attachment: wfs-multipoint.patch added

Tentative fix

comment:13 by pramsey, 16 years ago

nsavard, could you test the attached patch, I'm pretty sure it's the answer.

comment:14 by nsavard, 16 years ago

Paul: I'll check. Thanks.

comment:15 by nsavard, 16 years ago

For the record the CITE test used to output the bug is: wfs:test1.0.0-basic-getfeature-filter-spatialoperators-bbox-get-10 on thhttp://cite.opengeospatial.org/teamengine/ Web page.

comment:16 by nsavard, 16 years ago

Paul: I checked and this issue is fixed. Thank you again.

comment:17 by pramsey, 16 years ago

Resolution: fixed
Status: assignedclosed

Committed as of r7558.

comment:18 by pramsey, 16 years ago

Committed to branch-5-0 as of r7559.

Note: See TracTickets for help on using tickets.