[GIS] Setting up WMS with PostGIS, MapServer and Apache

apachemapserverpostgisshapefile

I am trying to setup a web map service (WMS) for rendering a few shape files that I have stored in a PostGIS database. I decided to use MapServer for rendering engine and has installed it on my Ubuntu machine with support of PostGIS. I have setup a virtual host in Apache for my project and I have found a partial setup from (http://postgis.refractions.net/docs/ch05.html), which shows connecting to PostGIS from Mapserver, e.g.

  LAYER 
    CONNECTIONTYPE postgis 
    NAME "widehighways"

    # Connect to a remote spatial database
    CONNECTION "user=dbuser dbname=gisdatabase host=bigserver"
    PROCESSING "CLOSE_CONNECTION=DEFER"
    # Get the lines from the 'geom' column of the 'roads' table 
    DATA "geom from roads using srid=4326 using unique gid" 

    STATUS ON
    TYPE LINE 
  END

However, I cannot find a complete example that shows serving tiled map from the mapserver. Can someone help with how to render png tiles from the map-server or point to an example. Thanks.

Best Answer

Well for the connection between mapserver and postgis you should check mapserver documentation at http://mapserver.org/input/vector/postgis.html

That's for the data connection, then you have to style your data (MapServer docs are great) and then decide which client to use.

You are asking for tiled pngs so I assume you are looking for a web mapping client. There are tons, depending on your context and requirements so I won't recommend one now.

Related Question