[Mapserver-dev] Re: Suggestion regarding EXPRESSION

Steve Lime steve.lime at dnr.state.mn.us
Thu Oct 23 16:17:53 EDT 2003


Hi Koji: No problem, good suggestion, my bad that it wasn't there in the
first place. I've commited this
to the 4.1 (main trunk) source tree. That's actually very stable code
so feel free to use it...

Steve

>>> "Koji Ueda" <uej at ika.hitachi-sk.co.jp> 10/23/2003 7:01:03 AM >>>
Hello,

I have been using MapServer for couple of months and am already
impressed very much with its functionalities.
BTW, I have one enhancement suggestion.
If you could incorporate it to the next version I would appreciate it
very much.

Currently, the EXPRESSION field in the map file does not allow me to
"compare" strings.
For example, I have a shape file which has date attribute like
"03-10-23"
and tried to perform a filter like ( '[DATE]' GE '03-01-01' ) in vain.
If you could add the following lines to mapparser.y 
before the line containing "string_exp IN string_exp",
this functionality can be instantly implemented.

       | string_exp GT string_exp      {
                                         if(strcmp($1, $3) > 0)
                       $$ = MS_TRUE;
                     else
                       $$ = MS_FALSE;
                       }
       | string_exp LT string_exp      {
                                         if(strcmp($1, $3) < 0)
                       $$ = MS_TRUE;
                     else
                       $$ = MS_FALSE;
                       }
       | string_exp GE string_exp      {
                                         if(strcmp($1, $3) >= 0)
                       $$ = MS_TRUE;
                     else
                       $$ = MS_FALSE;
                       }
       | string_exp LE string_exp      {
                                         if(strcmp($1, $3) <= 0)
                       $$ = MS_TRUE;
                     else
                       $$ = MS_FALSE;
                       }

Thank you in advance for your consideration.
Best Regards,
---
Koji Ueda
 Hitachi Software Engineering Co.,Ltd.
 Satellite Imagery Division




More information about the mapserver-dev mailing list