Mapserver Documentation Release 5.4.2
Total Page:16
File Type:pdf, Size:1020Kb
MapServer Documentation Release 5.4.2 The MapServer Team January 13, 2010 CONTENTS 1 About 3 2 An Introduction to MapServer 5 2.1 MapServer Overview ........................................... 5 2.2 Anatomy of a MapServer Application .................................. 6 2.3 Installation and Requirements ...................................... 8 2.4 Introduction to the Mapfile ........................................ 14 2.5 Making the Site Your Own ........................................ 21 2.6 Enhancing your site ........................................... 22 2.7 How do I get Help? ............................................ 24 3 MapServer Tutorial 25 3.1 Tutorial Timeframe ............................................ 25 3.2 Tutorial Data ............................................... 25 3.3 Before Using the Tutorial ........................................ 26 3.4 Windows, UNIX/Linux Issues ...................................... 26 3.5 Other Resources ............................................. 27 3.6 Section 1: Static Maps and the MapFile ................................. 27 3.7 Section 2: CGI variables and the User Interface ............................. 27 4 Installation 29 4.1 Compiling on Unix ............................................ 29 4.2 Compiling on Win32 ........................................... 37 4.3 PHP MapScript Installation ....................................... 44 4.4 .NET MapScript Compilation ...................................... 50 4.5 IIS Setup for MapServer ......................................... 55 4.6 Oracle Installation ............................................ 58 5 Mapfile 63 5.1 CLASS .................................................. 63 5.2 Expressions ................................................ 66 5.3 FEATURE ................................................ 71 5.4 FONTSET ................................................ 71 5.5 INCLUDE ................................................ 72 5.6 GRID ................................................... 74 5.7 JOIN ................................................... 75 5.8 LABEL .................................................. 79 5.9 LAYER .................................................. 82 5.10 LEGEND ................................................. 89 i 5.11 MAP ................................................... 89 5.12 OUTPUTFORMAT ........................................... 92 5.13 PROJECTION .............................................. 95 5.14 QUERYMAP ............................................... 96 5.15 REFERENCE .............................................. 97 5.16 SCALEBAR ............................................... 97 5.17 STYLE .................................................. 98 5.18 SYMBOL ................................................ 100 5.19 Cartographic Symbol Construction with MapServer .......................... 101 5.20 Symbology Examples .......................................... 123 5.21 Templating ................................................ 126 5.22 Variable Substitution ........................................... 134 5.23 WEB ................................................... 135 5.24 Notes ................................................... 136 6 MapScript 137 6.1 Introduction ............................................... 137 6.2 SWIG MapScript API Reference .................................... 138 6.3 PHP MapScript .............................................. 173 6.4 Python MapScript Appendix ....................................... 215 6.5 Python MapScript Image Generation .................................. 217 6.6 Mapfile Manipulation .......................................... 220 6.7 Querying ................................................. 223 6.8 MapScript Variables ........................................... 225 7 Data Input 233 7.1 Vector Data ................................................ 233 7.2 Raster Data ................................................ 289 8 Output Generation 301 8.1 AGG Rendering Specifics ........................................ 301 8.2 AntiAliasing with MapServer ...................................... 303 8.3 Dynamic Charting ............................................ 306 8.4 Flash Output ............................................... 311 8.5 HTML Legends with MapServer .................................... 316 8.6 HTML Imagemaps ............................................ 325 8.7 PDF Output ................................................ 328 8.8 SVG ................................................... 333 8.9 Tile Mode ................................................ 339 9 OGC Support and Configuration 345 9.1 WMS Server ............................................... 345 9.2 WMS Client ............................................... 364 9.3 WMS Time ................................................ 371 9.4 Map Context ............................................... 376 9.5 WFS Server ............................................... 383 9.6 WFS Client ................................................ 392 9.7 WFS Filter Encoding ........................................... 395 9.8 SLD .................................................... 402 9.9 WCS Server ............................................... 412 9.10 WCS Use Cases ............................................. 422 9.11 SOS Server ................................................ 427 9.12 MapScript Wrappers for WxS Services ................................. 438 10 Optimization 447 ii 10.1 Mapfile .................................................. 447 10.2 Vector ................................................... 449 10.3 Raster ................................................... 451 10.4 FastCGI .................................................. 452 10.5 Tile Indexes ............................................... 455 11 Utilities 459 11.1 legend .................................................. 459 11.2 msencrypt ................................................ 459 11.3 scalebar .................................................. 461 11.4 shp2img ................................................. 461 11.5 shptree .................................................. 463 11.6 shptreevis ................................................. 464 11.7 sortshp .................................................. 465 11.8 sym2img ................................................. 467 11.9 tile4ms .................................................. 468 11.10 Batch Scripting .............................................. 472 11.11 File Management ............................................. 472 12 CGI 475 12.1 MapServer CGI Introduction ....................................... 475 12.2 mapserv .................................................. 476 12.3 Map Context Files ............................................ 476 12.4 MapServer CGI Controls ......................................... 477 12.5 Run-time Substitution .......................................... 481 12.6 A Simple CGI Wrapper Script ...................................... 483 13 Community Activities 485 13.1 IRC .................................................... 485 13.2 Mailing Lists ............................................... 486 13.3 MapServer Wiki Pages .......................................... 487 13.4 MapServer Service Providers ...................................... 487 14 Development 489 14.1 Sponsors ................................................. 489 14.2 Bug Submission ............................................. 489 14.3 Subversion ................................................ 490 14.4 Documentation Development Guide ................................... 491 14.5 Testing .................................................. 497 14.6 Request for Comments .......................................... 503 14.7 Mapfile Editing .............................................. 665 14.8 External Links .............................................. 667 15 Download 669 15.1 Source .................................................. 669 15.2 Binaries .................................................. 669 15.3 Demo Application ............................................ 670 16 Glossary 671 17 Errors 675 17.1 drawEPP(): EPPL7 support is not available ............................... 675 17.2 loadMapInternal(): Given map extent is invalid ............................. 675 17.3 msSaveImageGD(): Unable to access file ................................ 676 17.4 msLoadMap(): Failed to open map file ................................. 677 iii 17.5 msQueryByPoint: search returned no results .............................. 677 17.6 msLoadFontset(): Error opening fontset ................................. 677 17.7 msGetLabelSize(): Requested font not found .............................. 678 17.8 loadLayer(): Unknown identifier. Maximum number of classes reached ................ 678 17.9 msReturnPage(): Web application error. Malformed template name .................. 678 17.10 Unable to load dll (MapScript) ...................................... 679 17.11 msProcessProjection(): Projection library error.major axis or radius = 0 not given ........... 679 17.12 msProcessProjection(): no options found in ‘init’ file .......................... 680 17.13 msProcessProjection(): No such file or directory ............................ 680 17.14 msQueryByPoint: search returned no results .............................. 680 18 FAQ 683 18.1 Where is the MapServer log file? .................................... 683 18.2 What books are available about MapServer? .............................