[mapserver-users] two values in runtime-substitution Filter vs. processing native_filter

Steve Lime sdlime at gmail.com
Fri Nov 1 12:45:10 PDT 2019


So you're seeing a different substitution result when using %key% in:

  FILTER '...%key%...'

versus:

  PROCESSING 'NATIVE_FILTER=...%key%'

If so that would be a bug. The value that replaces %key% should be
consistent. The value you supply could be different though because how the
expression is being further processed (e.g. MapServer vs. layer-specific
driver) is different. I'll have to whip up a quick test case to verify.

Otherwise I think in general you'd want to avoid lists if possible and send
things individually so key1=value1&key2=value2... and then use something
like:

    PROCESSING 'NATIVE_FILTER=...column in ('%key1%','%key2'%)

I would think validation would be easier in this case but I understand it
might not be practical with an indeterminate number of options. In that
case its probably best to send a completely encoded set of values (complete
with quotes) depending on the diver, so...

  key=%27value1%27%2C%27value2%27%2C%27value3%27

and then use:

  PROCESSING 'NATIVE_FILTER=...column in ('%key%)

I can't think of an alternative short of 1) adding the ability to split and
format strings before substitution (set a delimiter and a printf pattern)
or 2) adding a function like Perl's qw (quote word) that would handle
string delimiters for you qw(value1,value2). The latter would only work for
FILTERs,

--Steve

On Thu, Oct 31, 2019 at 3:31 AM Jörg Thomsen (WhereGroup) <
joerg.thomsen at wheregroup.com> wrote:

> Good morning everyone,
>
> we built an application which uses a runtime substitution for the filter
> string. And we found a different behavior between (the old) Filter and
> the native_processing filter if two values are parsed.
>
> the request http://....?..&key=vaule1,value2
> results to
> 'value1','value2' with the old FILTER () and to
> 'value1,value2'when using PROCESSING 'NATIVE_FILTER
>
> We have to use the PROCESSING 'NATIVE_FILTER, but need as result
> 'value1','value2', because we want to use it in a sql-query like:
> value in ('value1','value2').
>
> First question:
> has anyone an idea how to handle this? We could request
> http://....?..&key=value1','value2
> but that's no nice solution.
>
> Second question: is it the wanted behavior or perhaps a bug?
>
> Jörg
>
> --
>
> ***************************
> Where2B Konferenz 2019
> 12. Dezember 2019 in Bonn
> where2b-conference.com
> ***************************
>
> Jörg Thomsen
> WhereGroup GmbH
> Gillweg 3
> 14193 Berlin
> Germany
>
> Fon: +49 (0)30 / 5130 278 74
> Fax: +49 (0)30 / 5130 278 11
>
> joerg.thomsen at wheregroup.com
> www.wheregroup.com
>
> Geschäftsführer:
> Olaf Knopp, Peter Stamm
> Amtsgericht Bonn, HRB 9885
>
> -------------------------------
> Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20191101/b1435851/attachment.htm>


More information about the MapServer-users mailing list