[mapserver-users] RE Mapserver 7 expression

thomas bonfort thomas.bonfort at gmail.com
Thu Feb 18 07:10:48 PST 2016


Should be fixed with https://github.com/mapserver/mapserver/pull/5245
Thanks Andreas for pointing out the fix.

--
thomas

On 17 February 2016 at 08:30, Eichner, Andreas - SID <
Andreas.Eichner at sid.sachsen.de> wrote:

> This seems to be a bug. Each list item is compared to the filter item
> using strncmp() but it is not checked if it is the whole string. (see
> https://github.com/mapserver/mapserver/blob/157fa474ff8748ec42652f49dc4e2be4ca89042e/maputil.c#L490)
> So the result of the list expression is true if any item in the list is a
> _prefix_ of the filter item.
>
> So line 490 should probably read:
> if(!strncmp(start,shape->values[itemindex],end-start) &&
> shape->values[itemindex][end-start] == '\0') return MS_TRUE;
>
> You might file a bug report for this.
>
> HTH
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] Im
> > Auftrag von Steve.Toutant at inspq.qc.ca
> > Gesendet: Dienstag, 16. Februar 2016 21:02
> > An: mapserver-users at lists.osgeo.org; mapserver-users
> > Betreff: [mapserver-users] RE Mapserver 7 expression
> >
> > And this EXPRESSION {pluie,bruine}
> > will be true for this string attribute "pluie verglaçante"
> >
> > It seems that there is a problem when there is a space in the string
> > attribute
> >
> >
> >
> >
> >
> >
> > Steve.Toutant at inspq.qc.ca@lists.osgeo.org
> > Envoyé par : "mapserver-users" <mapserver-users-bounces at lists.osgeo.org>
> >
> > 2016-02-16 14:57 A
> > mapserver-users at lists.osgeo.org
> > cc
> > Objet
> > [mapserver-users] Mapserver 7 expression
> >
> >
> >
> >
> >
> >
> >
> >
> > Following this documentation
> > http://mapserver.org/fr/mapfile/expressions.html#list-expressions
> > <http://mapserver.org/fr/mapfile/expressions.html#list-expressions>
> > I created the class expression
> > EXPRESSION {pluie,bruine verglacante }
> >
> > My problem is that this expression return true when the string attribute
> > is "pluie verglacante"
> >
> > I would expect only "pluie" and "bruine verglacante" to be catched by
> this
> > expression...
> > How does list expressions work?
> > thanks
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> > <http://lists.osgeo.org/mailman/listinfo/mapserver-users>
> >
> >
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20160218/a70746b4/attachment.html>


More information about the mapserver-users mailing list