[OpenLayers-Users] Spatial Filter parameter for WFS GetFeature

bartvde at osgis.nl bartvde at osgis.nl
Tue Apr 27 09:06:15 EDT 2010


Hi,

you need to specify filterType. The control will take care of providing
the values. So:

var control = new OpenLayers.Control.GetFeature({
  ..
  filterType: OpenLayers.Filter.Spatial.INTERSECTS
  ..
});

Best regards,
Bart

>
> Dear Friends,
>
> I am trying to apply spatial filter to my GEtfeature requests on WFS layer
> atop a WMS.
>
> If I look at the spatial filter documentation
>
> http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Filter/Spatial-js.html
> http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Filter/Spatial-js.html
>
> I find that there are 3 things that need to be mentioned in all except the
> DWITHIN filter.
>
> What do I specify for 1) property 2) value parameter of the Spatial Filter
> constructor.
>
> The value parameter  requires either bounds or the geometry.How do I get
> that for the box I am creating?
>
> My code is:
>
>  control = new OpenLayers.Control.GetFeature({
>
>                    protocol: OpenLayers.Protocol.WFS({
>
>                        formatOptions: {
>                            outputFormat: "text/xml"
>                        },
>                        url:
> "/cgi-bin/mapserv.exe?map=c:/ms4w/apache/htdocs/Shape/Rail_wfs.map",
>                        featureType: 'RailwayStations',
>                        featurePrefix: 'ms',
>                        geometryName: 'msgeometry',
>                        maxFeatures: 100,
>                        var defaultFilter: new OpenLayers.Filter.Spatial({
> type: OpenLayers.Filter.Spatial.INTERSECTS})
>                    }),
>                    box: true,
>                    multipleKey: "shiftKey"
>
>                });
>
> Pls change the defaultFilter so that it gets the above two parameters.
>
> What is the purpose of BBOX Filter?
> How to use the "buffer" parameter for getting feature details outside of
> the
> box?
>
> Thanks for your attention & efforts.
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/Spatial-Filter-parameter-for-WFS-GetFeature-tp4968446p4968446.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>





More information about the Users mailing list