MapServer

From Seven
Jump to: navigation, search
OGC Compliance Certificate for MapServer

Please note that this page is outdated. For an installation description please refer to [http://metaspatial.net/w/index.php/Compiling_MapServer_7.0.1 Compiling MapServer 7.0.1

MapServer is an Open Source platform for publishing spatial data and interactive mapping applications to the web. Originally developed in the mid-1990’s at the University of Minnesota, MapServer is released under an MIT-style license, and runs on all major platforms (Windows, Linux, Mac OS X). MapServer is not a full-featured GIS system, nor does it aspire to be.

The MapServer Project Steering Committee (PSC), sanctioned by OSGeo, manages and administers the project which is maintained, improved, and supported by developers and users from around the world. See the community activities page for mailing lists, etc.

Contents

OGC Compliance and Standards Adherence

MapServer and included libraries have been tested and certified as compliant[1] to several OGC standards and implements several others including OGC WMS, WFS (non-transactional), SLD, SLD-SE, SFS, WCS, KML, GML, WKT, WKB and others. For a complete list of standards please check the full documentation on the MapServer web site. For complienace tests please check out the OGC CITE test and certificate listing.

"Compliance" and "Implementing"

The OGC distinguishes between "Compliance" and "Implementation" of an OGC standard.

  • "OGC Standards Compliance" means that the software has taken and passed the conformance tests and of the OGC CITE engine.
  • "Implementing OGC Standards" means that the software has implemented the OGC standard but has not (yet) run through an official OGC CITE test engine.

There are several reasons why a software may implement a standard but not go through the official CITE tests.

  1. Some standards cannot yet be officially tested and confirmed by the OGC because there no conformance classes or test methods have yet been implemented by the OGC.
  2. Going through a conformance test take considerable time and energy. The Project Steering Committee may decide that the implementation is "good enough" and a proof of conformance has lower priority than other tasks in the project.

If you believe that the conformance to a test is crucial you may consider to sponsor the test process. In this case please contact the Project Steering Committee directly.

Metaspatial Support

Metaspatial] has sponsored the OGC WMS conformance tests for MapServer for several years (most recently for version 6.4.2 in 2013). If you are interested in testing MapServer for a specific OGC standard you can contract Arnulf Christl through metaspatial to either guide you through the required process or coordinate the complete testing process on your behalf.

This is also an elegant way of "giving back" to the project and supporting the culture of Open Source.

Metaspatial operates the official OGC WMS Demo and Reference Server which runs a MapServer engine.

Notice

Please note that this is not the official end point for the MapServer project. Some of the information below this point may be out of date. But this page may contain some hints and tips for specific issues encountered when working with MapServer. Refer to http://www.mapserver.org for current and up-to-date information.


Compiling MapServer

You will typically not have to compile your build of MapServer manually. Instead you can take precompiled binaries for your systems. They come in different tastes and most serious operating systems will have them ready for you in their package management. Yes, there is an installer even for Windows available at Maptools.org. It is compiled by our friend Jeff McKenna from Gateway Geomatics. If you pay for Windows then please consider also paying him to do this work, it is a painful process and you would not be able to do it on your own.

If you have to compile MapServer on your own you find a lot of detailed instructions on the Web. If you have never done this before it is recommended to have quick read of a very brief introduction to what the whole thing means on Unix / Linux and then head on.

The first time it might get somewhat intricate but do not despair, there is a lot of friendly people around who can help. Just hop on IRC or the mailing lists. The following list is a breadcrumb through a Unix / Linux build:

See also MapServer on CentOS.

Compiling with SVG support

How to compile Mapserver 6.4.1 to use SVG symbols

  1. Install "librsvg2-dev"
  2. "cmake" with option "-DWITH_RSVG=ON"


Installation

You need a running CGI server to use MapServer. Apache HTTP Server works just fine:

install apt-get mapserver

To install MapServer 5.0.3 on Ubuntu 9.0.4 type:

sudo apt-get install cgi-mapserver

Ready. Add some tools by installing binaries:

sudo apt-get install mapserver-bin

Serving Maps

The MapServer software is installed a binary executable file. It typically resides in /usr/lib/cgi-bin/mapserv . There are two basic operations that any OGC WMS service must be able to answer and several optional extra requests:

  • GetCapabilities
  • GetMap
  • GetFeatureInfo (optional)
  • GetLegend (optional)
  • etc. (optional)

The GetCapabilities request returns the OGC WMS Capabilities document. It contains all the information that an OGC WMS client needs to be able to ask for maps via the GetMap request. MapServer has an extra request parameter (mandatory) that allows to pass a configuration file along with the GetCapabilites request. This configuration file is called the MAP file, it typically ends with the extension ".map". This file contains all the information that MapServer needs to access data and create an image that is returned as a map. Find the full documentation of the MAP file on the MapServer web sites:

A good introduction to the information that MapServer needs to generate maps can be found here:

Data

This tutorial will use a set of roads, railways, populated places, rivers and topography from the CIA factbook and postal codes, all for Germany. Download

The MAP file contains all the necessary information to access a data source and render cartographic map images. This workshop uses vector data:

Flat file format
  • Shape file consisting of
    • shp
    • shx
    • dbf
    • qix for indexes(optional)
Databases
  • PostgreSQL database with PostGIS extension

MapServer supports many more file formats as it uses GDAL/OGR.

Testing the Service

Query for an OGC WMS Capabilities document, it is the standard format for web map services. A correct Capabilities document tells you that the service is set up correctly but not whether the data can be read and rendered as a map. For that you need an application like Quantum GIS or Mapbender. Once you have installed MapServer on your local machine you can request for the Capabilities document using your browser: http://localhost/cgi-bin/mapserv?map=<enter-your-map-file-name-here>&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities

Exchange <enter-your-map-file-name-here> with the name and path to your MapServer MAP-file.

http://www.metaspatial.net/cgi-bin/mapserv?map=/home/data/germany/germany.map
http://www.metaspatial.net/cgi-bin/mapserv?map=/home/data/germany/germany.map&SERVICE=wms&REQUEST=GetCapabilities&VERSION=1.1.1

Using the Map Service

To use the OGC Web Map Service simply load the Capabilities of the corresponding service into your OGC WMS client.