[postgis-users] cannt connect in mapserver

Richard Greenwood Rich at GreenwoodMap.com
Thu Jul 10 06:40:09 PDT 2003


Did you start postgre with -i (postmaster -i &)? This enable tcp/ip 
connections, which is required by mapserver.

Rich

At 09:28 PM 7/10/2003 +0800, you wrote:

>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
>
>_______________________________________________
>postgis-users mailing list
>postgis-users at postgis.refractions.net
>http://postgis.refractions.net/mailman/listinfo/postgis-users


Richard W. Greenwood, PLS
Greenwood Mapping, Inc.
Rich <at> GreenwoodMap <dot> com
(307) 733-0203
http://www.GreenwoodMap.com 


More information about the postgis-users mailing list