[mapserver-users] From shapefiles to PostGIS, MAPServer

Richard Duivenvoorde rdmailings at duif.net
Sun Mar 9 08:14:09 PDT 2008


Hi Bruno,
I googled this pages for you :-) :
http://mapserver.gis.umn.edu/docs/reference/vector_data/postgis
here is another one: see the PostGIS DB section:
http://umn.mapserver.ch/index_en.php

Note: for views (tables?) you should have one unique column, and use it 
in your query using the 'unique'-keyword as shown below (which comes 
from a postgis/mapserver/debian cookbook I wrote a couple of days back 
http://www.duif.net/postgis ):

   layer
     name 'world'
     metadata
       "wms_title"                     "postgis world"
       "wms_srs"                       "epsg:4326"
     end
     status default
     template "dummy"
     connectiontype postgis
     connection "host=localhost dbname=mygisdb password=**** user=richard"
     data 'the_geom from mygisdb using unique gid using srid=4326'
     type polygon
     class
       color 255 0 0
       outlinecolor 192 192 192
     end
   end

Regards,

Richard Duivenvoorde

Bruno Ripa wrote:
> Hallo guys,
> 
>    i have worked on a Plone project handling a gis (using PrimaGIS 
> product); it used shapefiles to render the gis.
> Now i have translated all shapefiles into postgis and i can check it is 
> correct using QGis (under MacOSX).
> 
> The question is: where can i get some 'real' examples of how to create 
> Mapserver map file to let it read postgis data ? I have made some 
> 'blind' experiments, but it's not a good way to do things like that :D
> 
> In particular it would be nice to get map file sections documentation.
> 
> P.s.: the project runs on Debian.
> 
> Thanks in advance
> 




More information about the MapServer-users mailing list