[OpenLayers-Users] OpenLayers.Filter.Comparison.LIKE and singleChar

Arnd Wippermann arnd.wippermann at web.de
Thu Aug 5 17:50:22 EDT 2010


Hi Ian, Andreas

>>Ian's suggestion is an excellent one though, at least if you can control
how the SLD that OpenLayers
consumes looks.

I have thought, I could control it with OpenLayers. 

I take

function createFilterComparision(type, theField, theValue)
{
    var filter = new OpenLayers.Filter.Comparison({
        type: type,
        property: theField,
        value: theValue
    });
    filter.value2regex("%", "_"); //translation back to '*' and '.'

    return(filter);
}

to use other values for the wildCard and singleChar, in hope they get in the
SLD. But OpenLayers translate them back to '*' an '.'.

The SLD I create with OpenLayers hold '*' and '.' and reading this SLD to
style my features ends up with the issue, that '.' fails.

If i change manuel the singleChar in the created SLD and apply it to the
layer, then OpenLayers interprets it correctly.

But that's not what I want.

Nevertheless the Format.SLD and Filter is great. 

Arnd


-----Ursprüngliche Nachricht-----
Von: Andreas Hocevar [mailto:ahocevar at opengeo.org] 
Gesendet: Donnerstag, 5. August 2010 19:43
An: Arnd Wippermann
Cc: 'Ian Turton'; users at openlayers.org
Betreff: Re: [OpenLayers-Users] OpenLayers.Filter.Comparison.LIKE and
singleChar

Ian's suggestion is an excellent one though, at least if you can control how
the SLD that OpenLayers consumes looks.

Regards,
Andreas.

On Aug 5, 2010, at 19:08 , Arnd Wippermann wrote:

> Thanks Ian,
> 
> I have tried this, to test, if the SLD reader principal works. But I 
> wouldn't like this approach, because you have to remember, that you 
> changed the value for singleChar.
> 
> Arnd
> 
> -----Ursprüngliche Nachricht-----
> Von: Ian Turton [mailto:ijturton at gmail.com]
> Gesendet: Donnerstag, 5. August 2010 18:53
> An: Arnd Wippermann
> Cc: users at openlayers.org
> Betreff: Re: [OpenLayers-Users] OpenLayers.Filter.Comparison.LIKE and 
> singleChar
> 
> Another solution is to use a character other than . for the single 
> character wildcard so that it no longer looks like a number to the 
> parser. Try
> 
> <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
> <ogc:PropertyIsLike wildCard="*" singleChar="#" escape="!"> 
> <ogc:PropertyName>indice</ogc:PropertyName>
> <ogc:Literal>#2</ogc:Literal>
> </ogc:PropertyIsLike>
> </ogc:Filter>
> 
> 
> Ian
> 
> --
> Ian Turton
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users



--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.




More information about the Users mailing list