Creating Static Maps using MapServer and Quantum GIS

From CUOSGwiki
Jump to navigationJump to search

Disclaimer

This tutorial was developed for Micrsoft Windows platforms, visit the MapServer Organization website for alternatives to MS4W for Linux and OS platforms. This tutorial assumes working knowledge of GIS environments.

Introduction

This tutorial contains step-by-step instructions on how to create a static map using raster and vector data with MapServer.

Data

Suitable data for this tutorial can be found online from several locations which provide open geospatial data. Sample elevation data can be found in the GeoGratis Database. This is preferred because there are no restrictions and no cost on data accessed from GeoGratis. The required data for this tutorial must be a delimited text file consisting of X,Y coordinates with a Z height in meters for an extent and location of the participant's choosing. Additional vector data can be used in this tutorial to overlay on the raster surface.


It is important to place all of the data files in one project folder on the hard drive. Keep the folder path name simple and as short as possible, this path name will be used by MapServer to access data to display a map.

    Ex.  “C:\user\mapdemo”


Setup

MS4W and QGIS software must be installed on the participant's computer in order to begin this tutorial. The following is a brief installation guide.

Installing MS4W

Map Server for Windows (MS4W) is a base package for installing Map Server on Microsoft Windows platforms. The package was used in this tutorial because if provides a preconfigured package with all of the bits and pieces needed to run Map Server on a local Windows machine, such as Apache. The installation process is intuitive for novice users; visit the MapServer website for further tutorials and documentation.

Installing QGIS

The latest standalone version of QGIS for Windows is sufficient for this tutorial. If the computer you are using does not have QGIS installed, please download QGIS for Windows and direct the installation into your program files.

== Installation: ==


Data Processing

Once QGIS is installed, open the program and save a project file in the same folder as the data you collected for your map. Keep the project name simple.

    File -> Save Project As

Load the text file to display your elevation data. Select the appropriate delimiter used to separate the X,Y and Z values in the text file and select the appropriate coordinate system for the elevation data.

    Layer -> Add Delimited Text Layer

Export the Delimited Text layer by Right-Clicking the layer in the layers tab and selecting “Save As.” This will bring up a dialogue box, simply specify the file as an ESRI Shapefile with an appropriate coordinate system and save the file in your working folder. Be sure to select “Add saved file to map.” Delete the Delimited text file from your project.

Interpolate a raster surface using the new elevation point shapefile with the interpolation function built into QGIS. Specify the elevation point file as the input and Z as the interpolation attribute. Use the Inverse Distance Weighted (IDW) algorithm to create the Digital Elevation Model and specify an output file within your working folder. The defaults are acceptable for the remaining fields in the Interpolation dialogue.

    Raster -> Interpolation -> Interpolation

Example.jpg

Using the newly created raster surface you can choose to use the terrain analysis function built into QGIS to further analyze the elevation data.

    Raster -> Terrain Analysis -> Slope; Aspect; Hillshade; Relief; Ruggedness Index

To visualize your raster data, change the symbolization by right clicking the layer and selecting properties. Symbolization can be found in the style tab in the layer properties.