[Mapserver-users] can't connect postgis

=?gb2312?q?Chen=20Fu?= novalet at yahoo.com.cn
Mon Jul 7 07:51:05 EDT 2003


Hi!
I have some troubles in connecting postgis. As a
newbie , i don't know what's up :<

PostGis seems work fine in psql, i manually insert
some geometry data.

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))

the database call chenfu and user is postgres,
password is also postgres. (I confirm password several
time after i find connection failed)

I build mapserver with postgis.

[root at cbers mapserver-4.0b]# ./shp2img -v
MapServer version 4.0-beta1 OUTPUT=PNG OUTPUT=JPEG
OUTPUT=WBMP SUPPORTS=FREETYPE INPUT=TIFF INPUT=EPPL7
INPUT=JPEG INPUT=POSTGIS INPUT=SHAPEFILE

Then I try a simplest map file

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

But when i try shp2img on this map.
the result is 

msDrawMap(): Image handling error. Failed to draw
layer named 'test'.

My platform is redhat8.
Do you know what's wrong? any suggestion is welcome!
Thank you in advance!


=====
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 mapserver-users mailing list