Ticket #1113 (closed feature: duplicate)

Opened 6 years ago

Last modified 5 years ago

wfs filter: generated URL should not have a bbox if a filter is enabled

Reported by: ominiverdi Owned by: tschaub
Priority: minor Milestone: 2.7 Release
Component: Layer.WFS Version: 2.5
Keywords: Cc: ominiverdi
State:

Description (last modified by euzuro) (diff)

from the  example a simple filter is added:

<ogc:Filter xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc">
   <ogc:PropertyIsEqualTo>
    <ogc:PropertyName>SALB0</ogc:PropertyName>
    <ogc:Literal>FRA</ogc:Literal>
   </ogc:PropertyIsEqualTo>
</ogc:Filter>

the error shown is:

"filter and bbox both specified but are mutually exclusive"

 wrong call and  good call

patch posted by Lourens Veen

test soon

ciao Lorenzo

Attachments

WFS.js.patch Download (2.1 KB) - added by ominiverdi 6 years ago.
working patch. the original was not matching the options but the params array

Change History

Changed 6 years ago by ominiverdi

working patch. the original was not matching the options but the params array

follow-up: ↓ 2   Changed 5 years ago by openlayers

i've had a look at the patch, unfortunately it seems that the BBOX defined in the patch is hard coded for a particular SRS, and that it doesn't know about the name of the geomtery column, so i had to edit those to suit my setup.

so:

"<ogc:And><ogc:BBOX><ogc:PropertyName>" + this.geometry_column + "</ogc:PropertyName>" +

"<gml:Box srsname=\" http://www.opengis.net/gml/epsg.xml#28992\">" +

became this for me:

"<ogc:And><ogc:BBOX><ogc:PropertyName>GEOMETRY</ogc:PropertyName>" + "<gml:Box srsname=\"EPSG:4283\">" +

i'm guessing those values from be inherited from somewhere ?

other than that its great !! :)

-i

in reply to: ↑ 1   Changed 5 years ago by openlayers

so i see that this patch was never applied because the way the bbox is applied has changed.. however this bug is still present.

a fix needs to be made in Layers/WFS.js to disable the BBOX on the url if a filter is active:

here is what i did to fix this:

cheers ! -ivan


//ivan:  only append the bbox to the url is there is no filter supplied
//		url += "&" + OpenLayers.Util.getParameterString(params);
		if (url.indexOf("&filter=") == -1) {
			url += "&" + OpenLayers.Util.getParameterString(params);
		}
// end ivan




  Changed 5 years ago by thijsbrentjens

I've created a small patch to configure the use of the BBOX parameter. This might be useful here as well. See  http://trac.openlayers.org/ticket/1430

In addition: we should consider how a BBOX is added if a Filter is provided. The solution in this ticket is almost there I think :). But I think it would be a bit better if the Filter (layer.filter) is a full Filter expression, not the child of the Filter element as it seems to be now. Just a thought :).

  Changed 5 years ago by euzuro

  • description modified (diff)

  Changed 5 years ago by euzuro

  • milestone set to 2.7 Release

  Changed 5 years ago by bartvde

I guess this will automatically be fixed by the vector behaviour work?

  Changed 5 years ago by crschmidt

  • status changed from new to closed
  • resolution set to duplicate

This will be fixed in vector behavior (#1606) but not fixed in the 'old' WFS layer.

Note: See TracTickets for help on using tickets.