[postgis-users] cannt connect in mapserver

Chen Fu novalet at yahoo.com.cn
Thu Jul 10 06:28:23 PDT 2003


Hi!
I recently try to build a postgis on my redhat8 box as
a dynamic data source for mapserver webgis.

I can use psql to add some geometry into the table.

for example

chenfu=# select * from test;
 id |  name  |                geom
----+--------+------------------------------------
  1 | geom 1 | SRID=-1;POINT(1 1)
  2 | geom 2 | SRID=-1;LINESTRING(1 2,2 3)
  3 | geom 3 | SRID=-1;POLYGON((2 1,3 1,3 3,2 1))

But when i try to connect this table with a mapserver
map file. It doesn't work.

MAP
  NAME APPLE
  STATUS ON
EXTENT  -10 -10 10 10
UNITS METERS
SIZE 100 100
IMAGETYPE PNG

LAYER
CONNECTIONTYPE postgis
NAME "test"
CONNECTION "user=postgres password=postgres
dbname=chenfu host=localhost"
DATA "geom FROM test"
STATUS ON
TYPE LINE
END

END # Map File


Test this map file with shp2img, the output info is 

[root at cbers mapserver-4.0b]# ./shp2img -m my.map -o
my.png
msDrawMap(): Image handling error. Failed to draw
layer named 'test'.

Do you know what's wrong? How can i confirm my postgis
is correctly configured. Or is there any other way
besides mapserver to test the connection string is
correct?

I am blocked in this problem for almost one week long.
Thank you for any suggestion!


=====
Remote Scensing Satellite Ground Station
Chinese Academy of Science

_________________________________________________________
Do You Yahoo!? 
国内电邮用户反垃圾调查拉开帷幕
http://cn.rd.yahoo.com/mail_cn/tag/?http://cn.tech.yahoo.com/zhuanti/laji/index.html



More information about the postgis-users mailing list