Professional Documents
Culture Documents
MapServer Origins
Developed at UMN Remote Sensing Lab Funded by NASA Mission to Planet Earth Started as Arc/Info AML generation script Built on top of standard OpenSource projects like GD, Flex, Bison, FreeType, Proj.4 and libTIFF
System Characteristics
OpenSource software Implemented as a CGI program Written in ANSI C/C++ Source distribution
UNIX: autoconf and automake 95/98/NT: VC++ makefiles
Basic Functionality
Map creation Map component (eg. legend, scalebar and reference map) automation Web application building Simple feature query
Advanced Functionality...
Query by point, area or feature across multiple layers Quad-tree spatial indexing for shapefiles Support for tiled datasets (raster or vector) Label collision removal URL based configuration
Advanced Functionality
OpenGIS specification support for WMS, Context and WFS (partial) Programmatic access to underlying C APIMapScript (available for Perl, Python, Tk/Tcl, PHP and Java) 24-bit output support, including GDALbased output (e.g. GeoTIFF)
web server
HTTP
MapServer CGI
template files
config files
spatial data
MapServer application
augment config with user input via request (e.g. what layers and where)
request (HTTP)
MapServer CGI
response (HTTP)
spatial data
template files
create map components and/or execute a query, write components to temporary web space
System Installation
Build from source Install mapserv(.exe) in CGI directory Create writable (by the user the web server runs as) temporary image store
build your application
Map Object
MAP NAME application name STATUS ON|OFF IMAGECOLOR r g b UNITS METERS|FEET|INCHES| FONTSET filename SYMBOLSET filename SIZE x y Layers, Scalebar, Legend END
Legend Object
LEGEND STATUS ON|OFF KEYSIZE x y KEYSPACING x y LABEL parameters END IMAGECOLOR r g b END
Scalebar Object
SCALEBAR STATUS ON|OFF STYLE 0|1 INTERVALS n COLOR r g b BACKGROUNDCOLOR r g b OUTLINECOLOR r g b UNITS KILOMETERS|MILES|METERS| LABEL parameters END IMAGECOLOR r g b END
In a nut shell
This is controlled by the LAYER objects (and sub-objects), and a few MAP level These are controlled by parameters like SIZE the SCALEBAR object and EXTENT. and its LABEL object.
Controlled by the This is a template REFERENCE object. AFTER it has been processed by MapServer and returned to the users browser.
String Expressions
Fastest to evaluate, based on pure equality Denote using quotes Case sensitive Attribute identified using CLASSITEM
Examples: EXPRESSION Forest EXPRESSION 10
Regular Expressions
Fairly quick, advanced pattern matching Most useful with character data Denote using forward slashes Attribute identified using CLASSITEM
Examples: EXPRESSION /[Ff]orest/ EXPRESSION /hardwood|conifer/ EXPRESSION /2{2}/ EXPRESSION /./
Logical Expressions...
Slowest, but most flexible SQLlike syntax, can use multiple attributes Logical operators: eq, gt, lt, le, ge, ne, and, or Math operators: +, -, /, * and ^ Grouping using ()s Strings must be qouted Denote using ()s
...Logical Expressions
[ ]s must be used to delineate attributes, this is case sensitive Use of CLASSITEM not required
Examples: EXPRESSION ([AREA] > 10000) EXPRESSION ([AREA]/[PERIMETER] ge .5) EXPRESSION ([NAME] eq St. Paul or [ID] != 10)