Difference between revisions of "Configuring the Mapfile"

From ARK
Jump to: navigation, search
(Header)
(Header)
Line 16: Line 16:
 
     NAME "ARK WMS Map"
 
     NAME "ARK WMS Map"
 
     IMAGETYPE      PNG24
 
     IMAGETYPE      PNG24
     EXTENT 533866 180940 533963 181000
+
     EXTENT 533866 180940 533963 181000 ####Make sure this is valid
 
     SIZE          600 400
 
     SIZE          600 400
     SHAPEPATH      "C:/ms4w/Apache/htdocs/tutorial_ark/data/mapping/"
+
     SHAPEPATH      "C:/ms4w/Apache/htdocs/tutorial_ark/data/mapping/" ####Path to the shapefiles on the server
     IMAGECOLOR    250 250 250
+
     IMAGECOLOR    250 250 250 #### Background colour
     FONTSET        "C:/ms4w/Apache/htdocs/tutorial_ark/mapserver/fonts/fonts.list"
+
     FONTSET        "C:/ms4w/Apache/htdocs/tutorial_ark/mapserver/fonts/fonts.list" #### change this to match the location on your server
     SYMBOLSET      "C:/ms4w/Apache/htdocs/tutorial_ark/mapserver/symbols/symbols35.sym"
+
     SYMBOLSET      "C:/ms4w/Apache/htdocs/tutorial_ark/mapserver/symbols/symbols35.sym" #### change this to match the location on your server
 
     DEBUG ON
 
     DEBUG ON
 
     WEB
 
     WEB
 
       METADATA
 
       METADATA
       "wms_name" "ARK WMS"
+
       "wms_name" "ARK WMS"
       "wms_title" "ARK WMS"
+
       "wms_title" "ARK WMS"
       "wms_onlineresource" "http://www.lparchaeology.com/prescot/ark/php/map/ark_wxs_server.php"  
+
       "wms_onlineresource" "http://www.lparchaeology.com/prescot/ark/php/map/ark_wxs_server.php" #### change this your online address
       "wms_srs" "EPSG:27700"
+
       "wms_srs" "EPSG:27700" #### This is default to British National Grid - you may want to change to "EPSG:4326" (LatLongs)
 
       "wms_feature_info_mime_type" "text/html"
 
       "wms_feature_info_mime_type" "text/html"
 
       "wms_server_version" "1.1.1"
 
       "wms_server_version" "1.1.1"
Line 48: Line 48:
 
   #  Basic initial projection should be in ETRS89 / ETRS-LCC
 
   #  Basic initial projection should be in ETRS89 / ETRS-LCC
 
   #  This projection will also be dynamically set by the PHP
 
   #  This projection will also be dynamically set by the PHP
       "init=epsg:27700"
+
       "init=epsg:27700" #### Make sure this matches the wms_srs set above
 
   #
 
   #
 
   END
 
   END
 
   #
 
   #

Revision as of 16:36, 14 November 2008

Initial Setup

You need to ensure that Mapserver is setup to server as a WMS/WFS server. If you are not sure, please visit WMS Server HowTo and WFS Server HowTo.

The mapfiles themselves need to be setup manually per Mapserver setup - ARK will not write these for you unfortunately, so its worth undertaking the mapfile setup alongside the official mapfile documentation.

Example Mapfile

ARK uses two different mapfiles, the ark_wfs.map and ark_wms.php. These are found within the ark directory structure in mapserver/mapfiles/.

The files themselves should be reasonably self-explanatory if you have used Mapserver before.

Header

 MAP
   NAME "ARK WMS Map"
   IMAGETYPE      PNG24
   EXTENT 533866 180940 533963 181000 ####Make sure this is valid
   SIZE           600 400
   SHAPEPATH      "C:/ms4w/Apache/htdocs/tutorial_ark/data/mapping/" ####Path to the shapefiles on the server
   IMAGECOLOR     250 250 250 #### Background colour
   FONTSET        "C:/ms4w/Apache/htdocs/tutorial_ark/mapserver/fonts/fonts.list" #### change this to match the location on your server
   SYMBOLSET      "C:/ms4w/Apache/htdocs/tutorial_ark/mapserver/symbols/symbols35.sym"  #### change this to match the location on your server
   DEBUG ON
   WEB
     METADATA
     "wms_name"	"ARK WMS"
     "wms_title"	"ARK WMS"
     "wms_onlineresource"	"http://www.lparchaeology.com/prescot/ark/php/map/ark_wxs_server.php" #### change this your online address
     "wms_srs"  "EPSG:27700" #### This is default to British National Grid - you may want to change to "EPSG:4326" (LatLongs)
     "wms_feature_info_mime_type" "text/html"
     "wms_server_version" "1.1.1"
     END
     IMAGEPATH 'C:/ms4w/Apache/htdocs/tutorial_ark/mapserver/tmp/'
     IMAGEURL '/mapserver/tmp/'
     MAXSCALE 20000000
     MINSCALE 500
     LOG '/srv/www/htdocs/fasti/mapserver/mapfiles/ms_log.txt'
  END
  OUTPUTFORMAT
     NAME "png"
     MIMETYPE "image/png"
     DRIVER "GD/PNG"
     EXTENSION "png"
     IMAGEMODE "RGB"
  END
  PROJECTION
  #  Basic initial projection should be in ETRS89 / ETRS-LCC
  #  This projection will also be dynamically set by the PHP
      "init=epsg:27700"  #### Make sure this matches the wms_srs set above
  #
  END
  #