[postgis] mapserver connect to postgis?

Paul Ramsey pramsey at refractions.net
Wed Jan 2 09:36:29 PST 2002


Hi,

There are two possible fixes to try right off the bat:
1 - Set your mapserver 'STATUS' line to be 'DEFAULT' instead of 'ON'.
2 - There seems to be an & sign in your URL instead of an actual
ampersand (&).

P.

s8854617 wrote:
> 
> Dear Sir:
>   I am a student in Taiwan. I have a problem with my mapserver.
> my postgis table is following:
> testdb=# \d roads
>           Table "roads"
>  Attribute |   Type   | Modifier
> -----------+----------+----------
>  gid       | integer  |
>  geom      | geometry |
> Indices: roads_idx1,
>          roads_idx2
> My data is following:
> testdb=# select * from roads;
>  gid |               geom
> -----+-----------------------------------
>    1 | SRID=-1;LINESTRING(1 1,5 5,11 20)
> (1 row)
> My map file is following:
> NAME EX3
> SIZE 600 600
> EXTENT 1.0 1.0 30.0 30.0
> LAYER
>   CONNECTIONTYPE postgis
>   NAME "Roads"
>   CONNECTION "user=postgres dbname=testdb"
>   DATA "geom from roads"
>   STATUS ON
>   TYPE LINE
>   FILTER "gid > 0"
>   CLASS
>   EXPRESSION ([gid] > 0)
>   COLOR 255 0 0
>   END
> END
> END # Fim do MapFile
> 
> And my html file is following:
> <html>
> <head>
> <title>My First Test for Mapserver</title>
> </head>
> <body>
> <img border="1" src="/cgi-bin/mapserv?map=/var/www/html/itasca/ex3.map&mode=
> map">
> </body>
> </html>
> 
> It seems to be OK for me. But I try to browse the HTML file, it
> just show nothing but a square. Could you tell me where I did wrong?
> Or tell me how to make sure the Mapserver connect to PostGIS and
> retrive data successful?
> 
>              Thank Your help
>                     Whang Yeong Chong
> ==================================================================
> ·s®öºô¡D§K¶O¹q¤l«H½c  http://www.sinamail.com
> 
> 
> To unsubscribe from this group, send an email to:
> postgis-unsubscribe at yahoogroups.com
> 
> 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

-- 
      __
     /
     | Paul Ramsey
     | Refractions Research
     | Email: pramsey at refractions.net
     | Phone: (250) 885-0632
     \_

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Tiny Wireless Camera under $80!
Order Now! FREE VCR Commander!
Click Here - Only 1 Day Left!
http://us.click.yahoo.com/WoOlbB/7.PDAA/ySSFAA/PhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the postgis-users mailing list