[mapserver-users] How to use PostGIS with itemquery?
s8854617
s8854617 at sinamail.com
Sun Feb 3 21:53:39 PST 2002
Hi everybody:
I am trying using MapServer with itemquery to access the table in
PostGIS. But I got a message:
msPOSTGISLayerWhichShapes(): Query error. prep_DB:Error executing
POSTGIS DECLARE statement (0.6 failed - retried 0.5 and it failed
too).
Following is my template & map files:
My template HTML:
<html>
<head>
<title>Let US GO! GO! GO!</title>
</head>
<body>
<br>
<form method="get" action="/cgi-bin/mapserv">
<input type="hidden" name="map" value="/var/www/html/itasca/tuto4.map">
<input type="hidden" name="mode" value="itemquery">
<input type="hidden" name="qlayer" value="test">
The ID:<input size=1 name="judger">
<input type="submit" value="submit">
</form>
</body>
</html>
My tuto4.map (Map file) is:
NAME EX3
SIZE 500 400
EXTENT 208385 2672226 209810 2673639
FONTSET /var/www/html/itasca/fonts.list
UNITS meters
IMAGECOLOR 255 255 255
IMAGETYPE PNG
WEB
IMAGEPATH "/var/www/html/tmp/"
IMAGEURL "/tmp/"
END
QUERYMAP
STATUS ON
STYLE HILITE
COLOR 255 255 0
END
LAYER
NAME test
CONNECTIONTYPE postgis
CONNECTION "user=postgres dbname=testdb"
DATA "shape from post_map"
STATUS DEFAULT
TYPE POLYGON
FILTER "value_08 = judger"
CLASS
COLOR 0 255 0
OUTLINECOLOR 0 0 0
TEMPLATE tuto3_show.html
END
END
END # Fim do MapFile
My query template tuto3_show.html:
<html>
<head>
<title>That is a SHOW!!</title>
<body bgcolor="#ffffff">
<p>
This is a test
<p>
<img border="2" src="[img]">
</body>
</html>
My post_map table is PostGIS:
testdb=# \d post_map
Table "post_map"
Attribute | Type | Modifier
-----------+--------------+----------
lid_01 | character(4) |
lid_02 | character(4) |
lid_03 | character(4) |
shape | geometry |
aa08 | character(1) |
value_08 | integer |
I want the "judger" variable can be assign a value from the go3.html
by users, then tuto4.map filter data with the judger (in
FILTER "value_08 = judger").
Could anyone tell me where I must fix ? Thank you very much.
Whang Yeong Chong
==================================================================
〔新浪網公告〕
上網免撥接費! [帳號] sina [密碼] sina at u2online [撥接電話] 4050-8888,
或請至http://u2.sina.com.tw/sina下載自動設定軟體
More information about the MapServer-users
mailing list