[mapserver-users] MapServer 3.5 & Postgis

Paul Ramsey pramsey at refractions.net
Wed May 15 11:23:16 EDT 2002


The problem is with the 'STATUS' line. It is counter-intuitive, but
setting the STATUS to ON does not actually turn on the layer. It just
sets its default state to on, in case you are reading the map object in
Mapscript or something. You have to either set the status to DEFAULT
(good for testing) or explicitly request it in your URL.

P.

lists wrote:
> 
> Hi
> 
> I'm a newbie with GIS, so please have patience :)
> 
> I have installed the PostGIS 0.7 extension with Postgresql 7.2 (RedHat
> 7.3), and PostGIS seems fine. I have managed to convert and input shp file
> data.
> 
> I have also compiled mapserver 3.5 and the itasca demo works fine.
> I compiled mapserver with this ./configure :
> 
> ./configure --with-proj=/usr/local/lib --with-postgis=yes --with-wmsclient
> 
> I then wrote a simple map file for the data I had input into postgres.
> This is the abandoned mine land data from http://www.nationalatlas.gov/atlasftp.html
> 
> When reading directly from shp files, this .map file works :
> 
> NAME EX1
> EXTENT -159.6 28.77 -71.4667 70.5
> SIZE 400 300
> SHAPEPATH "../data"
> LAYER # start of the "mines" layer object
>   NAME "mines"
>   DATA abnminx020
>   STATUS DEFAULT
>   TYPE POINT
>   CLASS
>     COLOR 120 120 220
>     OUTLINECOLOR 10 10 0
>   END # end of class object
> END # end of layer object
> END # end of map file
> 
> However, if I add :
>   CONNECTIONTYPE local
> into the LAYER section, I get this error :
> 
> <HTML>
> <HEAD><TITLE>MapServer Message</TITLE></HEAD>
> <!-- MapServer version 3.5 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
> SUPPORTS=PROJ SUPPORTS=TTF SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
> INPUT=TIFF INPUT=EPPL7 INPUT=JPEG INPUT=POSTGIS INPUT=SHAPEFILE -->
> <BODY BGCOLOR="#FFFFFF">
> getSymbol(): Symbol definition error. (local):(5)
> </BODY></HTML>
> 
> If I change the map file to read from the database :
> 
> NAME EX2
> EXTENT -159.6 28.77 -71.4667 70.5
> SIZE 400 300
> LAYER # start of the "mines" layer object
>   CONNECTIONTYPE postgis
>   NAME "mines"
>   CONNECTION "user=xxx password=xxx dbname=mines host=localhost port=5432"
>   DATA "the_geom from themines"
>   STATUS ON
>   TYPE POINT
>   CLASS
>     COLOR 120 120 220
>     OUTLINECOLOR 10 10 0
>   END # end of class object
> END # end of layer object
> END # end of map file
> 
> then I get a plain white .png with no detail at all.
> 
> Any help would be much appreciated - I'm rather stumped at the moment !
> 
> Regards and thanks in advance
> 
> Arif Saleem

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



More information about the mapserver-users mailing list