[mapserver-users] Problem with Variable Substitution for EXPRESSION

Prabu Raja prab.raja at gmail.com
Wed May 9 02:55:43 EDT 2012


Hi,

I just wanted to update what solved my problem, it may help for somebody
else.

I had given the substitution variable inside parentheses and it worked.

*Not working :* EXPRESSION ([TOTPOP1] >= %V1% AND [TOTPOP1] < %V2%)

*Working : *EXPRESSION ([TOTPOP1] >= (%V1%) AND [TOTPOP1] < (%V2%))

I am using ms4w (tested with version 3 and  version 3.0.4 ) from
maptools.org.

On Tue, Nov 22, 2011 at 8:56 PM, Lime, Steve D (DNR) <Steve.Lime at state.mn.us
> wrote:

> I'm going to try a copy of the mapfile here and see what happens... Will
> report back later today.
>
> Steve
>
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org [mailto:
> mapserver-users-bounces at lists.osgeo.org] On Behalf Of Jeff McKenna
> Sent: Tuesday, November 22, 2011 8:36 AM
> To: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] Problem with Variable Substitution for
> EXPRESSION
>
> Hello,
>
> If I was in your situation, I would follow Steve's advice and test it
> through the commandline (mapserv -nh QUERY_STRING="blah") to test your
> request in normal CGI mode.
>
> Then if all else fails, create a very small one layer mapfile with a
> tiny data file and package that with a requests.txt file, and submit
> that to the MapServer Issue Tracker, or event point to it here on the list.
>
> -jeff
>
>
> --
> Jeff McKenna
> MapServer Consulting and Training Services
> http://www.gatewaygeomatics.com/
>
>
>
>
> On 11-11-22 5:25 AM, Prabu Raja wrote:
> > Hi Steve / Daniel,
> >
> > I am using ms4w from http://maptools.org/ms4w/index.phtml in Windows 7.
> >
> > Following is my map file content.
> >
> > MAP
> > NAME ms_sql
> > IMAGECOLOR 255 255 255
> > # default output image dimensions
> > SIZE 256 256
> > # Is the map active? Sometimes you may wish to turn this off to
> > # use only the reference map or scale bar.
> > STATUS ON
> > CONFIG "MS_ERRORFILE" "\var\Map\error.txt"
> > DEBUG 0
> > # set top level projection
> > PROJECTION
> > "init=epsg:4326"
> > END
> > # image format options
> > OUTPUTFORMAT
> >    NAME "png"
> >    DRIVER AGG/PNG
> >        MIMETYPE "image/png"
> >        IMAGEMODE RGBA
> >        EXTENSION "png"
> >    TRANSPARENT ON
> >        FORMATOPTION "GAMMA=0.75"
> >     END
> > EXTENT -180 -90 180 90 # World
> >
> >     LAYER
> >        VALIDATION
> > 'V1' '^[-+]?[0-9]*\.?[0-9]+$'
> > 'V2' '^[-+]?[0-9]*\.?[0-9]+$'
> > 'V3' '^[-+]?[0-9]*\.?[0-9]+$'
> > 'V4' '^[-+]?[0-9]*\.?[0-9]+$'
> > 'V5' '^[-+]?[0-9]*\.?[0-9]+$'
> > 'V6' '^[-+]?[0-9]*\.?[0-9]+$'
> >        END
> >        NAME "state"
> >        TYPE polygon
> >        STATUS ON
> >        CONNECTIONTYPE POSTGIS
> >        CONNECTION "host=localhost dbname=pollutionmap user=***
> > password=***   port=5432"
> >        DATA "wkb_geometry FROM  (SELECT ogc_fid AS
> > oid, wkb_geometry, totpop1 FROM state_tst) AS SUBQUERY using unique oid"
> >        PROCESSING "CLOSE_CONNECTION=DEFER"
> >        CLASSITEM "totpop1"
> >        OPACITY 100
> >        CLASS
> >           EXPRESSION ([TOTPOP1] >= %V1% AND [TOTPOP1] < %V2%)
> >           STYLE
> >              COLOR 255 108 118
> >              OUTLINECOLOR 255 255 255
> >           END
> >        END
> >        CLASS
> >           EXPRESSION ([TOTPOP1] >= %V2% AND [TOTPOP1] < %V3%)
> >           STYLE
> >              COLOR 254 189 75
> >              OUTLINECOLOR 255 255 255
> >           END
> >        END
> >        CLASS
> >           EXPRESSION ([TOTPOP1] >= %V3% AND [TOTPOP1] < %V4%)
> >           STYLE
> >              COLOR 254 247 46
> >              OUTLINECOLOR 255 255 255
> >           END
> >        END
> >        CLASS
> >           EXPRESSION ([TOTPOP1] >= %V4% AND [TOTPOP1] < %V5%)
> >           STYLE
> >              COLOR 39 251 114
> >              OUTLINECOLOR 255 255 255
> >           END
> >        END
> >        CLASS
> >           EXPRESSION ([TOTPOP1] >= %V5% AND [TOTPOP1] <= %V6%)
> >           STYLE
> >              COLOR 108 111 205
> >              OUTLINECOLOR 255 255 255
> >           END
> >        END
> >     END
> > END
> >
> > Below are the url's through I am trying to generate map
> >
> >
> http://localhost/fcgi-bin/mapserv.exe?map=/var/Map/State.map&layers=state&mode=map&V1=60650.45&V2=33288104.54&V3=66515558.222&V4=99743012.123&V5=132970466.455&V6=166197921.245
> > <
> http://localhost/fcgi-bin/mapserv.exe?map=/var/Map/State.map&layers=state&mode=map&V1=60650.45&V2=33288104.54&V3=66515558.222&V4=99743012.123&V5=132970466.455&V6=166197921.245
> >
> >
> >
> http://localhost/fcgi-bin/mapserv.exe?map=/var/Map/State.map&layers=state&mode=map&V1=60650&V2=33288104&V3=66515558&V4=99743012&V5=132970466&V6=166197921
> > <
> http://localhost/fcgi-bin/mapserv.exe?map=/var/Map/State.map&layers=state&mode=map&V1=60650&V2=33288104&V3=66515558&V4=99743012&V5=132970466&V6=166197921
> >
> >
> >
> > Accessing through above 2 url gives '500 Internal Server Error'.
> > No error message in mapserver log.
> >
> > Following error message logged in apache error log.
> > [warn] [client 127.0.0.1] (OS 109)The pipe has been ended.  : mod_fcgid:
> > get overlap result error
> > [error] [client 127.0.0.1] Premature end of script headers: mapserv.exe
> >
> > And following was logged in appache access log
> >
> > GET
> >
> /fcgi-bin/mapserv.exe?map=/var/Map/State.map&layers=state&mode=map&V1=60650.45&V2=33288104.54&V3=66515558.222&V4=99743012.123&V5=132970466.455&V6=166197921.245
> > HTTP/1.1" 500 533
> >
> >
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> 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
>



-- 
Regards,
Prabu Raja
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120509/b7722717/attachment.html


More information about the mapserver-users mailing list