[OpenLayers-Dev] WFS layer and filter

SWEYKAM at telefonica.net SWEYKAM at telefonica.net
Thu Dec 16 13:03:27 EST 2010


Hi list,
I have a particular WFS layer here which is giving me trouble and I need some help on identifying the correct geometryName and the filter property.

It’s gazetteer service and I want to apply comparison filters eventually. 

var myFilter = new OpenLayers.Filter.Comparison({
         type: "~",
         property: "nombreEntidad", //no
         value: "Madrid" 
});


So far I’ve managed to display points on my map using Strategy.Fixed without any filter:  

var myLayer = new OpenLayers.Layer.Vector( "my title",   {              
   strategies: [new OpenLayers.Strategy.Fixed()],
   protocol: new OpenLayers.Protocol.WFS({
      url: "http://www.idee.es/IDEE-WFS-Nomenclator-NGC/services?",
      featureType: 'Entidad', 
      featurePrefix: 'mne',
      featureNS :  "http://www.idee.es/mne",
      readFormat: new OpenLayers.Format.GML(),
      srsName: "EPSG:4230",
      version: '1.1.0',    
      maxFeatures: 10,
      extractAttributes: true
   }),
   projection: new OpenLayers.Projection("EPSG:4230"),
   // filter: myFilter;
});

I tried setting the filter property to "nombre" or "nombreEntidad" – with and without prefix, but no luck. ("PropertyName " nombreEntidad" cannot be resolved”).
For applying any spatial filters or just the BBOX strategy I’d have to indicate additionally the geometryName which I haven’t figured out either.

Besides, I can select features but the attribute values are null (feature.attributes have the expected keys but their values are null). 

Does anybody have a clue? I could post some XML if it’s of help.

I’d also like to know if there is any difference in terms of performance between 
1) filterStrategy, 2) filter, and 3) style with a rule and a filter. I guess the third option is slowest but what about the other 2 options?

Best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20101216/2b0272b5/attachment.html


More information about the Dev mailing list