Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#3139 closed defect (fixed)

WFS layer returns error if no results in bbox

Reported by: jimk Owned by: assefa
Priority: normal Milestone: 5.6 release
Component: WFS Client Version: svn-trunk (development)
Severity: normal Keywords:
Cc: assefa, dmorissette, warmerdam

Description

msDrawMap(): Image handling error. Failed to draw layer named 'Wetlands'. msOGRLayerGetItems(): General error message. Assertion failed: OGR layer not opened!!!

This occurs when msWFSLayerWhichShapes finds no shapes and returns MS_DONE instead of opening the OGR layer. This is a delemma because the OGR layer cannot be opened in the case of no GML (mapwfslayer.c:1005 No overlap so nothing to request) or no features in the GML (mapwfslayer.c:1089). However the newer msLayerGetItems code assumes the layer is open to query items.

So... I added a flag (bLayerHasValidGML) to msWFSLayerInfo to indicate if the OGR dataset has been opened. If it is not set, but the WFS layer opened successfully then we are in a VALID case where the WFS request correctly returned no features.

The patch works (because in the core mapserver if msLayerWhichItems() returns MS_DONE no further action is taken on that layer) but is incomplete as the entries in the vtable that go directly to OGR functions should probably also check the bLayerHasValidGML flag before jumping to OGR. (Problems could occur in case of a msLayerGetShape or from mapscript).

Attachments (1)

mapwfslayer.c.patch (1.6 KB ) - added by jimk 15 years ago.

Download all attachments as: .zip

Change History (6)

by jimk, 15 years ago

Attachment: mapwfslayer.c.patch added

comment:1 by sdlime, 15 years ago

Any comments from anyone? Seems like this needs to be fixed before releasing 5.6.

Steve

comment:2 by dmorissette, 15 years ago

Cc: assefa dmorissette warmerdam added
Milestone: 5.6 release
Owner: changed from mapserverbugs to aboudreault

I wish I had time to look into this. I'll assign to Alan to have a look. Unless Assefa or Frank can take it?

comment:3 by assefa, 15 years ago

Owner: changed from aboudreault to assefa

I will look at it and commit the fix tomorrow.

comment:4 by assefa, 15 years ago

Resolution: fixed
Status: newclosed

committed in r9469.

in reply to:  4 comment:5 by jimk, 15 years ago

Replying to assefa:

committed in r9469.

Thanks!

Note: See TracTickets for help on using tickets.