[mapserver-users] query query
lists
lists at mail.office.webstar.co.uk
Mon Jun 17 08:02:47 PDT 2002
Hi
I am having a bit of difficulty using the QUERY mode with mapserver - and
was wondering if someone could point out my error.
I'm using MS 3.6 with Postgis.
I have a .map file with these (relevant) bits :
//--------------
NAME WALES
EXTENT 127000.0 160000.0 380000.0 402000.0
SIZE 400 400
WEB
TEMPLATE wales2.html
IMAGEPATH "/var/www/html/mapserver/wales/tmp/"
IMAGEURL "/mapserver/wales/tmp/"
END
LAYER # start of the "cardiff_codes" layer object
CONNECTIONTYPE postgis
NAME "cardiff_codes"
CONNECTION "host=127.0.0.1 port=5432 user=blah password=blah dbname=mines"
DATA "the_geom from walescp"
STATUS DEFAULT
TYPE POINT
TOLERANCE 5
CLASSITEM unit_postc
CLASS
NAME "Post Codes"
COLOR 180 80 120
SYMBOL 'circle'
SIZE 2
EXPRESSION /./
#TEMPLATE http://ewok/mapserver/wales/show.php?id=[ID]
TEMPLATE postcode.html
END # end of class object
END # end of layer object
END # end of map file
//----------------------------
And postcode.html :
<html>
<body>
<b>SEARCH WINDOW</b>: [imgext]<br>
<b>QUERY POINT</b>: ([img.x], [img.y]) image coordinates or ([mapx], [mapy]) map coordinates<br>
<b>QUERY METRICS</b>: number of layers with results=[nl], total number of results=[nr]<br>
<p>
<hr>
<p>
Post Code = [UNIT_POSTC]
</body>
</html>
When I use query mode to get the post code of a point, all I get is
//---
Post Code = [UNIT_POSTC]
//---
literally, without the value for that unit_postc being substituted from
the database.
I tried to follow the itasca demo as closely as possible, but mine won't
print the data. Is there a difference between using shape files (as in the
Itasca demo) and using Postgres ? Or is there something I've done totally
wrong ?
Any help would be much appreciated
Regards
arif saleem
More information about the MapServer-users
mailing list