<br><font size=2 face="sans-serif">Since you don't have a FILTERITEM I
don't I don't understand why this is working </font><tt><font size=2>FILTER
(%wfilter%)</font></tt>
<br>
<br>
<br><font size=2 face="sans-serif">Perhaps you should use the brackets
and "" if the data type is a string</font>
<br><font size=2 face="sans-serif">Per example, if uc is char I would
write this</font>
<br><font size=2 face="sans-serif">FILTER ("[</font><tt><font size=2>uc</font></tt><font size=2 face="sans-serif">]"
= "%vucv%")</font>
<br><font size=2 face="sans-serif">If it is a number</font>
<br><font size=2 face="sans-serif">FILTER ([</font><tt><font size=2>uc</font></tt><font size=2 face="sans-serif">]
= "%vucv%")</font>
<br>
<br>
<p>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Stephen Davies <sdavies@sdc.com.au>@lists.osgeo.org</b>
</font>
<br><font size=1 face="sans-serif">Envoyé par : mapserver-users-bounces@lists.osgeo.org</font>
<p><font size=1 face="sans-serif">2011-08-30 21:33</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Veuillez répondre à<br>
sdavies@sdc.com.au</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">A</font></div>
<td><font size=1 face="sans-serif">mapserver-users@lists.osgeo.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Objet</font></div>
<td><font size=1 face="sans-serif">[Polluriel potentiel] Re: [mapserver-users]
Issue with run-time substitution?</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br>
<br>
<br><tt><font size=2>I have further reduced a test map file and changed
the sequence of statements <br>
but one substitution still fails.<br>
<br>
I have a number of other map files where substitution works as expected
and the <br>
wfilter substitution in this example also works as expected but I cannot
see <br>
what is different about the vucv case.<br>
<br>
The URL looks like this:<br>
<br>
http://www.agua.com.au/cgi-bin/mapserv?map=/tmp/q.map<br>
&mapext=138.4324071+-35.2807010+138.5729945+-35.1222989<br>
&mre=-1070114.26+-4230140.65+289096.72+-2872042.86<br>
&wfilter=id+in+%2847%29&vucv=137_11<br>
<br>
The minimal map file is:<br>
<br>
# template map file for Agua Soil Database Water Mgt<br>
#<br>
MAP<br>
NAME watermgt<br>
<br>
<br>
PROJECTION<br>
"proj=eqc"<br>
"ellps=GRS80"<br>
"towgs84=0,0,0"<br>
"no_defs"<br>
"lon_0=138.503e"<br>
END<br>
<br>
SIZE 600 600<br>
FONTSET "/var/www/html2/benparts/fonts.list"<br>
SYMBOLSET "/var/www/html2/benparts/symbols"<br>
UNITS METERS<br>
IMAGETYPE jpeg<br>
OUTPUTFORMAT<br>
NAME 'AGG_JPEG'<br>
DRIVER AGG/JPEG<br>
IMAGEMODE RGB<br>
FORMATOPTION "QUALITY=100"<br>
END<br>
IMAGECOLOR 255 255 255<br>
<br>
WEB<br>
template /var/www/html2/benparts/templates/test1.html<br>
imagepath "/var/www/html2/tmp/"<br>
imageurl "/tmp/"<br>
LOG "/tmp/mapserv.log"<br>
END<br>
<br>
LEGEND<br>
KEYSIZE 18 12<br>
LABEL<br>
TYPE BITMAP<br>
SIZE MEDIUM<br>
COLOR 0 0 94<br>
END<br>
STATUS ON<br>
END<br>
<br>
LAYER<br>
TYPE RASTER<br>
NAME "bkgrnd"<br>
STATUS ON<br>
PROJECTION<br>
"init=epsg:4283"<br>
END<br>
DATA "/var/www/html2/benparts/rasters/JB_Onka_IPOS_Ver2.jpg"<br>
PROCESSING "DITHER=YES"<br>
END<br>
<br>
LAYER<br>
CONNECTIONTYPE postgis<br>
NAME "weather"<br>
DATA "geom from weather_station"<br>
CONNECTION "user=scldad dbname=benparts"<br>
PROCESSING "CLOSE_CONNECTION=DEFER"<br>
STATUS ON<br>
TYPE POINT<br>
VALIDATION<br>
wfilter 'id in.*'<br>
END<br>
FILTER (%wfilter%)<br>
PROJECTION<br>
"init=epsg:4283"<br>
END<br>
LABELITEM "name"<br>
CLASS<br>
NAME "Weather Station"<br>
STYLE<br>
COLOR 214
0 0<br>
SYMBOL 'circle'<br>
SIZE 7<br>
END<br>
LABEL<br>
MINDISTANCE 150<br>
POSITION CR<br>
SIZE TINY<br>
COLOR 9 9 9<br>
STYLE<br>
GEOMTRANSFORM 'labelpoly'<br>
COLOR 255
255 255<br>
END<br>
END<br>
END<br>
END<br>
<br>
LAYER<br>
CONNECTIONTYPE postgis<br>
NAME "battery"<br>
VALIDATION<br>
vucv '.*'<br>
END<br>
DATA "geom from wmd using unique id using SRID=4283"<br>
CONNECTION "user=scldad dbname=benparts"<br>
STATUS ON<br>
TYPE POINT<br>
FILTER (uc='%vucv%' and stype='B')<br>
PROJECTION<br>
"init=epsg:4283"<br>
END<br>
MAXSCALE 5000000<br>
LABELITEM "label"<br>
CLASSITEM "state"<br>
CLASS<br>
EXPRESSION "G"<br>
STYLE<br>
COLOR 0 255
0<br>
SYMBOL 'dot'<br>
SIZE 7<br>
OFFSET 17 0<br>
END<br>
LABEL<br>
POSITION CR<br>
TYPE TRUETYPE<br>
FONT arial<br>
SIZE 8<br>
COLOR 0 255 0<br>
OFFSET 20 0<br>
FORCE TRUE<br>
STYLE<br>
GEOMTRANSFORM
'labelpoly'<br>
COLOR 255 255 255<br>
END<br>
END<br>
END<br>
CLASS<br>
EXPRESSION "A"<br>
STYLE<br>
COLOR 255
215 0<br>
SYMBOL 'dot'<br>
SIZE 7<br>
OFFSET 17 0<br>
END<br>
LABEL<br>
POSITION CR<br>
TYPE TRUETYPE<br>
FONT arial<br>
SIZE 8<br>
COLOR 255 215 0<br>
OFFSET 20 0<br>
FORCE TRUE<br>
STYLE<br>
GEOMTRANSFORM
'labelpoly'<br>
COLOR 255 255 255<br>
END<br>
END<br>
END<br>
CLASS<br>
EXPRESSION "R"<br>
STYLE<br>
COLOR 255
0 0<br>
SYMBOL 'dot'<br>
SIZE 7<br>
OFFSET 17 0<br>
END<br>
LABEL<br>
POSITION CR<br>
TYPE TRUETYPE<br>
FONT arial<br>
SIZE 12<br>
COLOR 255 0 0<br>
OFFSET 20 0<br>
FORCE TRUE<br>
STYLE<br>
GEOMTRANSFORM
'labelpoly'<br>
COLOR 255 255 255<br>
END<br>
END<br>
END<br>
END<br>
#<br>
# Start of reference map<br>
#<br>
REFERENCE<br>
IMAGE /var/www/html2/benparts/refmaps/sa.png<br>
EXTENT -1070114.26 -4230140.65 289096.72 -2872042.86<br>
SIZE 120 120<br>
STATUS ON<br>
MINBOXSIZE 5<br>
MAXBOXSIZE 100<br>
COLOR 0 255 0<br>
OUTLINECOLOR 0 0 0<br>
MARKERSIZE 8<br>
MARKER 'star'<br>
END<br>
#<br>
# Start of scalebar<br>
#<br>
SCALEBAR<br>
IMAGECOLOR 0 0 0<br>
LABEL<br>
COLOR 255 255 255<br>
SIZE TINY<br>
END<br>
STYLE 1<br>
SIZE 200 2<br>
COLOR 255 255 255<br>
UNITS KILOMETERS<br>
INTERVALS 2<br>
TRANSPARENT TRUE<br>
STATUS ON<br>
END<br>
END<br>
<br>
When I run this, the Postgresql log shows:<br>
<br>
LOG: duration: 0.127 ms execute <unnamed>: select <br>
"name",encode(ST_AsBinary(ST_Force_2D("geom"),'NDR'),'hex')
as geom,"id" from <br>
weather_station where geom && GeomFromText('POLYGON((138.42349975
<br>
-35.280701,138.42349975 -35.1222989,138.58190185 -35.1222989,138.58190185
<br>
-35.280701,138.42349975 -35.280701))',find_srid('','weather_station','geom'))
<br>
and (id in (47))<br>
LOG: duration: 0.060 ms execute <unnamed>: select <br>
"state","label",encode(ST_AsBinary(ST_Force_2D("geom"),'NDR'),'hex')
as <br>
geom,"id" from wmd where geom && GeomFromText('POLYGON((138.42349975
<br>
-35.280701,138.42349975 -35.1222989,138.58190185 -35.1222989,138.58190185
<br>
-35.280701,138.42349975 -35.280701))',4283) and (uc='%vucv%' and stype='B')<br>
<br>
This illustrates that the wfilter substitution worked but the vucv substitution
<br>
did not.<br>
<br>
Cheers,<br>
Stephen<br>
-- <br>
=============================================================================<br>
Stephen Davies Consulting P/L
Voice: 08-8177
1595<br>
Adelaide, South Australia.
Fax :
08-8177 0133<br>
Records & Collections Management.
Mobile:040 304 0583<br>
_______________________________________________<br>
mapserver-users mailing list<br>
mapserver-users@lists.osgeo.org<br>
http://lists.osgeo.org/mailman/listinfo/mapserver-users<br>
</font></tt>
<br>
<br>
<br>