Re: [mapserver-users] Problem with Variable Substitution for EXPRESSION

2012-05-08 Thread Prabu Raja
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)  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-boun...@lists.osgeo.org [mailto:
> mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jeff McKenna
> Sent: Tuesday, November 22, 2011 8:36 AM
> To: mapserver-users@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&#x

RE: [mapserver-users] Problem with Variable Substitution for EXPRESSION

2011-11-22 Thread Lime, Steve D (DNR)
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-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jeff McKenna
Sent: Tuesday, November 22, 2011 8:36 AM
To: mapserver-users@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@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Problem with Variable Substitution for EXPRESSION

2011-11-22 Thread Jeff McKenna

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&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@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Problem with Variable Substitution for EXPRESSION

2011-11-22 Thread Prabu Raja
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&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



On Wed, Nov 16, 2011 at 9:14 PM, Daniel Morissette  wrote:

> Which binaries are you using?
>
> If you your own custom build then are you sure it's not a case of multiple
> versions of REGEX on the same system? That used to be a problem in the old
> days with PHP's local copy of regex conflicting with the system regex, but
> I don't think that is a problem any more though.
>
>
>
> On 11-11-16 10:40 AM, Lime, Steve D (DNR) wrote:
>
>> Well, that’s not good is it. Hmmm… I ran a quick test here using this
>> mapfile:
>>
>> MAP
>>
>> NAME 'test'
>>
>> SIZE 450 600
>>
>> EXTENT 125000 4785000 788000 5489000
>>
>> IMAGETYPE PNG8
>>
>> LAYER
>>
>> VALIDATION
>>
>> 'area' '^[-+]?[0-9]*\.?[0-9]+$'
>>
>> END
>>
>> NAME 'county'
>>
>> STATUS DEFAULT
>>
>> TYPE POLYGON
>>
>> DATA ' bdry_counpy2'
>>
>> CLASS
>>
>> EXPRESSION ([area] > %area%)
>>
>> STYLE COLOR 212 212 212 OUTLINECOLOR 0 0 0 END
>>
>> END
>>
>> END
>>
>> END
>>
>> This is against 6.0 latest trunk although I don’t think there have been
>> any changes in that area…
>>
>> I can run something like:
>>
>

Re: [mapserver-users] Problem with Variable Substitution for EXPRESSION

2011-11-16 Thread Daniel Morissette

Which binaries are you using?

If you your own custom build then are you sure it's not a case of 
multiple versions of REGEX on the same system? That used to be a problem 
in the old days with PHP's local copy of regex conflicting with the 
system regex, but I don't think that is a problem any more though.



On 11-11-16 10:40 AM, Lime, Steve D (DNR) wrote:

Well, that’s not good is it. Hmmm… I ran a quick test here using this
mapfile:

MAP

NAME 'test'

SIZE 450 600

EXTENT 125000 4785000 788000 5489000

IMAGETYPE PNG8

LAYER

VALIDATION

'area' '^[-+]?[0-9]*\.?[0-9]+$'

END

NAME 'county'

STATUS DEFAULT

TYPE POLYGON

DATA ' bdry_counpy2'

CLASS

EXPRESSION ([area] > %area%)

STYLE COLOR 212 212 212 OUTLINECOLOR 0 0 0 END

END

END

END

This is against 6.0 latest trunk although I don’t think there have been
any changes in that area…

I can run something like:

mapserv -nh "QUERY_STRING=map=test.map&mode=map&area=5" > test.png

If ‘area’ parameter is provided as a non-double then the substitution
isn’t done. I believe the substitution validation errors fail silently.
This example works, how different is what you’re doing?

Steve

*From:*Prabu Raja [mailto:prab.r...@gmail.com]
*Sent:* Wednesday, November 16, 2011 5:16 AM
*To:* Lime, Steve D (DNR)
*Cc:* mapserver-users@lists.osgeo.org
*Subject:* Re: [mapserver-users] Problem with Variable Substitution for
EXPRESSION

Thanks Steve.

Tried the following regular expression

"[-+]?[0-9]*\.?[0-9]+".

For which the internal server error is coming from Apache. No error
logged in mapserver log.


  "Internal Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.*"*

On Tue, Nov 15, 2011 at 8:37 PM, Lime, Steve D (DNR)
mailto:steve.l...@state.mn.us>> wrote:

See http://www.regular-expressions.info/floatingpoint.html for some good
examples.

Steve

*From:*mapserver-users-boun...@lists.osgeo.org
<mailto:mapserver-users-boun...@lists.osgeo.org>
[mailto:mapserver-users-boun...@lists.osgeo.org
<mailto:mapserver-users-boun...@lists.osgeo.org>] *On Behalf Of *Prabu Raja
*Sent:* Tuesday, November 15, 2011 4:29 AM
*To:* mapserver-users@lists.osgeo.org
<mailto:mapserver-users@lists.osgeo.org>
*Subject:* [mapserver-users] Problem with Variable Substitution for
EXPRESSION

Hi,

I need to compare one attribute from database table in "EXPRESSION"
(under "LAYER") with six different values passed as Variable
Substitution for coloring the layer.

I did added validation for those variables in the map file, but for some
reason I am getting the below error.

*msValidateParameter(): Regular expression error. Parameter pattern
validation failed.*

*msEvalRegex(): Regular expression error. String failed expression test.*

*msValidateParameter(): Regular expression error. Parameter pattern
validation failed.*

Could anyone help me with where I am wrong? Below is the map file
content for this layer.

All the six variables would be numbers (may be a decimal number), Is my
regular expression correct?

WEB

VALIDATION

value_one "^[\d+(\.\d)]*$"

value_two "^[\d+(\.\d)]*$"

value_three "[^\d+(\.\d)]*$"

value_four "[^\d+(\.\d)]*$"

value_five "[^\d+(\.\d)]*$"

value_six "[^\d+(\.\d)]*$"

END

END


LAYER

NAME "state"

TYPE polygon

STATUS ON

CONNECTIONTYPE POSTGIS

CONNECTION "user=postgres password=** dbname=shpdb host=localhost
port=5432"

DATA "the_geom FROM (SELECT gid, the_geom, totpop1 FROM state_shape) AS
SUBQUERY using unique gid"

PROCESSING "CLOSE_CONNECTION=DEFER"

CLASSITEM "totpop1"

OPACITY 100

CLASS

EXPRESSION ([TOTPOP1] >= %value_one% AND [TOTPOP1] < %value_two%)

STYLE

COLOR 255 108 118

OUTLINECOLOR 255 255 255

END

END

CLASS

EXPRESSION ([TOTPOP1] >= %value_two% AND [TOTPOP1] < %value_three%)

STYLE

COLOR 254 189 75

OUTLINECOLOR 255 255 255

END

END

CLASS

EXPRESSION ([TOTPOP1] >= %value_three% AND [TOTPOP1] < %value_four%)

STYLE

COLOR 254 247 46

OUTLINECOLOR 255 255 255

END

END

CLASS

EXPRESSION ([TOTPOP1] >= %value_four% AND [TOTPOP1] < %value_five%)

STYLE

COLOR 39 251 114

OUTLINECOLOR 255 255 255

END

END

CLASS

EXPRESSION ([TOTPOP1] >= %value_five% AND [TOTPOP1] <= %value_six%)

STYLE

COLOR 108 111 205

OUTLINECOLOR 255 255 255

END

END

END

--
Regards,
Prabu Raja



--
Regards,
Prabu Raja



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



--
Daniel Morissette
http://www.mapgears.com/
Provider of Professional MapServer Support since 2000

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] Problem with Variable Substitution for EXPRESSION

2011-11-16 Thread Lime, Steve D (DNR)
Well, that’s not good is it. Hmmm… I ran a quick test here using this mapfile:

MAP
  NAME 'test'
  SIZE 450 600
  EXTENT 125000 4785000 788000 5489000

  IMAGETYPE PNG8

  LAYER
VALIDATION
  'area' '^[-+]?[0-9]*\.?[0-9]+$'
END
NAME 'county'
STATUS DEFAULT
TYPE POLYGON
DATA ' bdry_counpy2'
CLASS
  EXPRESSION ([area] > %area%)
  STYLE COLOR 212 212 212 OUTLINECOLOR 0 0 0 END
END
  END
END

This is against 6.0 latest trunk although I don’t think there have been any 
changes in that area…

I can run something like:

mapserv -nh "QUERY_STRING=map=test.map&mode=map&area=5" > test.png

If ‘area’ parameter is provided as a non-double then the substitution isn’t 
done. I believe the substitution validation errors fail silently. This example 
works, how different is what you’re doing?

Steve

From: Prabu Raja [mailto:prab.r...@gmail.com]
Sent: Wednesday, November 16, 2011 5:16 AM
To: Lime, Steve D (DNR)
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Problem with Variable Substitution for EXPRESSION

Thanks Steve.

Tried the following regular expression

"[-+]?[0-9]*\.?[0-9]+".

For which the internal server error is coming from Apache. No error logged in 
mapserver log.
"Internal Server Error

The server encountered an internal error or misconfiguration and was unable to 
complete your request."



On Tue, Nov 15, 2011 at 8:37 PM, Lime, Steve D (DNR) 
mailto:steve.l...@state.mn.us>> wrote:
See http://www.regular-expressions.info/floatingpoint.html for some good 
examples.

Steve

From: 
mapserver-users-boun...@lists.osgeo.org<mailto:mapserver-users-boun...@lists.osgeo.org>
 
[mailto:mapserver-users-boun...@lists.osgeo.org<mailto:mapserver-users-boun...@lists.osgeo.org>]
 On Behalf Of Prabu Raja
Sent: Tuesday, November 15, 2011 4:29 AM
To: mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org>
Subject: [mapserver-users] Problem with Variable Substitution for EXPRESSION

Hi,

I need to compare one attribute from database table in "EXPRESSION" (under 
"LAYER") with six different values passed as Variable Substitution  for 
coloring the layer.

I did added validation for those variables in the map file, but for some reason 
I am getting the below error.

msValidateParameter(): Regular expression error. Parameter pattern validation 
failed.
msEvalRegex(): Regular expression error. String failed expression test.
msValidateParameter(): Regular expression error. Parameter pattern validation 
failed.

Could anyone help me with where I am wrong? Below is the map file content for 
this layer.

All the six variables would be numbers (may be a decimal number), Is my regular 
expression correct?

WEB
   VALIDATION
  value_one "^[\d+(\.\d)]*$"
  value_two "^[\d+(\.\d)]*$"
  value_three   "[^\d+(\.\d)]*$"
  value_four"[^\d+(\.\d)]*$"
  value_five"[^\d+(\.\d)]*$"
  value_six "[^\d+(\.\d)]*$"
   END
END

LAYER
   NAME "state"
   TYPE polygon
   STATUS ON
   CONNECTIONTYPE POSTGIS
   CONNECTION  "user=postgres password=** dbname=shpdb host=localhost 
port=5432"
   DATA "the_geom FROM  (SELECT gid, the_geom, totpop1 FROM state_shape) AS 
SUBQUERY using unique gid"
   PROCESSING "CLOSE_CONNECTION=DEFER"
   CLASSITEM "totpop1"
   OPACITY 100
   CLASS
 EXPRESSION ([TOTPOP1] >= %value_one% AND [TOTPOP1] < %value_two%)
 STYLE
COLOR 255 108 118
OUTLINECOLOR 255 255 255
 END
   END
   CLASS
  EXPRESSION ([TOTPOP1] >= %value_two% AND [TOTPOP1] < %value_three%)
 STYLE
COLOR 254 189 75
OUTLINECOLOR 255 255 255
 END
   END
   CLASS
 EXPRESSION ([TOTPOP1] >= %value_three% AND [TOTPOP1] < %value_four%)
 STYLE
COLOR 254 247 46
OUTLINECOLOR 255 255 255
 END
   END
   CLASS
 EXPRESSION ([TOTPOP1] >= %value_four% AND [TOTPOP1] < %value_five%)
 STYLE
COLOR 39 251 114
OUTLINECOLOR 255 255 255
 END
   END
   CLASS
 EXPRESSION ([TOTPOP1] >= %value_five% AND [TOTPOP1] <= %value_six%)
 STYLE
COLOR 108 111 205
OUTLINECOLOR 255 255 255
 END
   END
END
--
Regards,
Prabu Raja



--
Regards,
Prabu Raja
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Problem with Variable Substitution for EXPRESSION

2011-11-16 Thread Prabu Raja
Thanks Steve.

Tried the following regular expression

"[-+]?[0-9]*\.?[0-9]+".

For which the internal server error is coming from Apache. No error logged
in mapserver log.  "Internal Server Error

The server encountered an internal error or misconfiguration and was unable
to complete your request."



On Tue, Nov 15, 2011 at 8:37 PM, Lime, Steve D (DNR)  wrote:

>  See http://www.regular-expressions.info/floatingpoint.html for some good
> examples.
>
> ** **
>
> Steve
>
> ** **
>
> *From:* mapserver-users-boun...@lists.osgeo.org [mailto:
> mapserver-users-boun...@lists.osgeo.org] *On Behalf Of *Prabu Raja
> *Sent:* Tuesday, November 15, 2011 4:29 AM
> *To:* mapserver-users@lists.osgeo.org
> *Subject:* [mapserver-users] Problem with Variable Substitution for
> EXPRESSION
>
> ** **
>
> Hi,
>
> ** **
>
> I need to compare one attribute from database table in "EXPRESSION" (under
> "LAYER") with six different values passed as Variable Substitution  for
> coloring the layer.
>
> ** **
>
> I did added validation for those variables in the map file, but for some
> reason I am getting the below error.
>
> ** **
>
> *msValidateParameter(): Regular expression error. Parameter pattern
> validation failed.*
>
> *msEvalRegex(): Regular expression error. String failed expression test.**
> ***
>
> *msValidateParameter(): Regular expression error. Parameter pattern
> validation failed.*
>
> ** **
>
> Could anyone help me with where I am wrong? Below is the map file content
> for this layer. 
>
> ** **
>
> All the six variables would be numbers (may be a decimal number), Is my
> regular expression correct? 
>
> ** **
>
> WEB
>
>VALIDATION
>
>   value_one "^[\d+(\.\d)]*$"
>
>   value_two "^[\d+(\.\d)]*$"
>
>   value_three   "[^\d+(\.\d)]*$"
>
>   value_four"[^\d+(\.\d)]*$"
>
>   value_five"[^\d+(\.\d)]*$"
>
>   value_six "[^\d+(\.\d)]*$"
>
>END
>
> END
>
>
> 
>
> LAYER 
>
>NAME "state" 
>
>TYPE polygon
>
>STATUS ON 
>
>CONNECTIONTYPE POSTGIS
>
>CONNECTION  "user=postgres password=** dbname=shpdb host=localhost
> port=5432"
>
>DATA "the_geom FROM  (SELECT gid, the_geom, totpop1 FROM state_shape)
> AS SUBQUERY using unique gid"
>
>PROCESSING "CLOSE_CONNECTION=DEFER"
>
>CLASSITEM "totpop1"
>
>OPACITY 100
>
>CLASS 
>
>  EXPRESSION ([TOTPOP1] >= %value_one% AND [TOTPOP1] < %value_two%)
>
>  STYLE 
>
> COLOR 255 108 118
>
> OUTLINECOLOR 255 255 255
>
>  END 
>
>END
>
>CLASS
>
>   EXPRESSION ([TOTPOP1] >= %value_two% AND [TOTPOP1] < %value_three%)*
> ***
>
>  STYLE 
>
> COLOR 254 189 75
>
> OUTLINECOLOR 255 255 255
>
>  END 
>
>END
>
>CLASS 
>
>  EXPRESSION ([TOTPOP1] >= %value_three% AND [TOTPOP1] < %value_four%)
>
>  STYLE 
>
> COLOR 254 247 46 
>
> OUTLINECOLOR 255 255 255
>
>  END 
>
>END
>
>CLASS 
>
>  EXPRESSION ([TOTPOP1] >= %value_four% AND [TOTPOP1] < %value_five%)
>
>  STYLE 
>
> COLOR 39 251 114
>
> OUTLINECOLOR 255 255 255
>
>  END 
>
>END
>
>CLASS 
>
>  EXPRESSION ([TOTPOP1] >= %value_five% AND [TOTPOP1] <= %value_six%)
>
>  STYLE 
>
> COLOR 108 111 205
>
> OUTLINECOLOR 255 255 255
>
>  END 
>
>END
>
> END
>
> --
> Regards,
> Prabu Raja
>



-- 
Regards,
Prabu Raja
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] Problem with Variable Substitution for EXPRESSION

2011-11-15 Thread Lime, Steve D (DNR)
See http://www.regular-expressions.info/floatingpoint.html for some good 
examples.

Steve

From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Prabu Raja
Sent: Tuesday, November 15, 2011 4:29 AM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Problem with Variable Substitution for EXPRESSION

Hi,

I need to compare one attribute from database table in "EXPRESSION" (under 
"LAYER") with six different values passed as Variable Substitution  for 
coloring the layer.

I did added validation for those variables in the map file, but for some reason 
I am getting the below error.

msValidateParameter(): Regular expression error. Parameter pattern validation 
failed.
msEvalRegex(): Regular expression error. String failed expression test.
msValidateParameter(): Regular expression error. Parameter pattern validation 
failed.

Could anyone help me with where I am wrong? Below is the map file content for 
this layer.

All the six variables would be numbers (may be a decimal number), Is my regular 
expression correct?

WEB
   VALIDATION
  value_one "^[\d+(\.\d)]*$"
  value_two "^[\d+(\.\d)]*$"
  value_three   "[^\d+(\.\d)]*$"
  value_four"[^\d+(\.\d)]*$"
  value_five"[^\d+(\.\d)]*$"
  value_six "[^\d+(\.\d)]*$"
   END
END

LAYER
   NAME "state"
   TYPE polygon
   STATUS ON
   CONNECTIONTYPE POSTGIS
   CONNECTION  "user=postgres password=** dbname=shpdb host=localhost 
port=5432"
   DATA "the_geom FROM  (SELECT gid, the_geom, totpop1 FROM state_shape) AS 
SUBQUERY using unique gid"
   PROCESSING "CLOSE_CONNECTION=DEFER"
   CLASSITEM "totpop1"
   OPACITY 100
   CLASS
 EXPRESSION ([TOTPOP1] >= %value_one% AND [TOTPOP1] < %value_two%)
 STYLE
COLOR 255 108 118
OUTLINECOLOR 255 255 255
 END
   END
   CLASS
  EXPRESSION ([TOTPOP1] >= %value_two% AND [TOTPOP1] < %value_three%)
 STYLE
COLOR 254 189 75
OUTLINECOLOR 255 255 255
 END
   END
   CLASS
 EXPRESSION ([TOTPOP1] >= %value_three% AND [TOTPOP1] < %value_four%)
 STYLE
COLOR 254 247 46
OUTLINECOLOR 255 255 255
 END
   END
   CLASS
 EXPRESSION ([TOTPOP1] >= %value_four% AND [TOTPOP1] < %value_five%)
 STYLE
COLOR 39 251 114
OUTLINECOLOR 255 255 255
 END
   END
   CLASS
 EXPRESSION ([TOTPOP1] >= %value_five% AND [TOTPOP1] <= %value_six%)
 STYLE
COLOR 108 111 205
OUTLINECOLOR 255 255 255
 END
   END
END
--
Regards,
Prabu Raja
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users