Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

Projection Information

The standard MapServer install will have a library of projection information. We’re only interested generally in British National Grid and this can be defined in each MapServer file rather than reading in an entire projection library.

Replace this
CONFIG “PROJ_LIB” “..\..\..\mapserver\shared\proj\nad”
PROJECTION
  “init=epsg:27700”
END
With this
PROJECTION
  “proj=tmerc”
  “lat_0=49”
  “lon_0=-2”
  “k=0.999601”
  “x_0=400000”
  “y_0=-100000”
  “ellps=airy”
  “units=m”
  “no_defs”
END

Logging

If your MapServer map file is in on a production server it will have passed all testing so there’s no reason to keep debugging to a high level. Set DEBUG 0. Remove all mentions of DEBUG in individual layers.

Symbol Sets

Same procedure as projections here. Remove all SYMBOL definitions that are not used by your layers. Either define the symbols in the map file or reference an edited SYMBOLSET file. See the topic Configure MapServer Cartography for details.

Font Sets

Same procedure again. Identify which fonts are being used by your map file and remove unnecessary FONT definitions in the fonts.list. If you are not using any fonts then remove the FONTSET line.

Shape Path

This is often a standard parameter in the MapServer map file but if you are not using any shape files [.shp] then it can be removed.

PostgreSQL data

Use an INCLUDE for the PostgreSQL CONNECTION details. By using the following setup MapServer will attempt to use the same connection for all the PostgreSQL LAYERs.

INCLUDE Example
LAYER
   NAME councils
   INCLUDE "datashare.inc"
   ...
END

 

Now you need to create a .txt file with the name "datashare.inc", or whatever you have called it in your INCLUDE statement, with the following information. This file needs to reside in the same folder as the .map file unless you have added a path in the INCLUDE statement.

CONNECTION “user=me password=nottelling dbname=isharedata host=127.0.0.1”
CONNECTIONTYPE POSTGIS
PROCESSING “CLOSE_CONNECTION=DEFER”

On some setups there is a delay in resolving to "localhost" so if the IP address is known use it. In this case we’re using the local instance of PostgreSQL.

  • No labels