Creating Static Maps using MapServer and Quantum GIS

From CUOSGwiki
Revision as of 20:22, 14 December 2012 by Emily Lindsay (talk | contribs) (Created page with " == Disclaimer == This tutorial was developed for Micrsoft Windows platforms, visit the MapServer Organization website for alternatives to MS4W for Linux and OS platforms. This …")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 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 data needed for this tutorial needs to be a delimited text file consisting of X,Y coordinates with a Z height in metres. 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 pathname simple and as short as possible, this pathname will be used by mapserver to access data to display a map. Ex. “C:\user\mapdemo”


Methods

Installation:

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 installation into your program files.

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 and can be downloaded from the MS4W website. Visit the MapServer website for further tutorials and documentation.

Data Processing – Raster Creation

- 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 the Z attribute as seen in Figure 1. 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 rest of the Interpolation dialogue.

Raster -> Interpolation -> Interpolation


Figure 1: The Interpolation dialogue to create a successful DEM in QGIS from Elevation data.

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

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.