1 / 30

GIS and the Internet

GIS and the Internet. Getting started with the UMN MapServer. MapServer Origins. Developed at UMN Remote Sensing Lab Funded by NASA “Mission to Planet Earth” Started as Arc/Info AML generation script

pegeen
Download Presentation

GIS and the Internet

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GIS and the Internet Getting started with the UMN MapServer

  2. 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

  3. 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

  4. Basic Functionality • Map creation • Map component (eg. legend, scalebar and reference map) automation • Web application building • Simple feature query Basic Demonstration Application

  5. Advanced Functionality ... • On-the-fly projection (w/Proj.4) • Feature annotation including scaling, rotation, outlines and drop shadows • TrueType labels and symbols (w/FreeType) • Feature classification- string comparision, regex and logical expressions • Scale dependent display and query

  6. … 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

  7. … Advanced Functionality • OpenGIS specification support for WMS, Context and WFS (partial) • Programmatic access to underlying C API- MapScript (available for Perl, Python, Tk/Tcl, PHP and Java) • 24-bit output support, including GDAL-based output (e.g. GeoTIFF)

  8. Supported File Formats • Vector Formats • ESRI Shapefiles and SDE layers • Inline vector features • Database sources- SDE, Oracle Spatial, PostGIS • Raster Formats (8-bit only) • TIFF*/GeoTIFF • EPPL7 • WMS • Numerous additional formats via GDAL/OGR * indicates files that must be accompanied by an ESRI world file for georeferencing

  9. MapServer Output Formats • varies based upon software build configuration • image formats include GIF, PNG (8/24 bit), JPEG, WBMP, and GDAL • vector formats include GML (via WMS/WFS or templates), PDF, SWF (Flash) and SVG (via templates) • templates can be any text-based format (default is HTML)

  10. So, how does it work? • Each application is configured using a text file called a “map” file • A user adds to the configuration using an HTML form (e.g. layers, area of interest) • Program results are run through a series of templates depending on the application (e.g. data browse, feature query) • And the process begins again…

  11. How MapServer Works… web server HTTP MapServer CGI HTTP MapServer application template files config files spatial data

  12. config files spatial data request (HTTP) response (HTTP) template files … How MapServer Works augment config with user input via request (e.g. what layers and where) MapServer CGI create map components and/or execute a query, write components to temporary web space

  13. 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

  14. Typical Application Layout  test (whole application stored in one place)  test.map file  graphics (images used in application)  symbols (symbol files and icons)  fonts (font files and index list)  data (GIS data)  *.html (supporting HTML and templates) Map file is referred to using it’s full path relative to the location of the MapServer CGI binary.

  15. MapServer Map Files • Text based, hierarchical • Control all aspects of an application • legends, scalebars, reference maps • layer definitions • web template definitions simple one layer example

  16. Map File Caveats • Case insensitive (with few exceptions) • Paths for files are given relative to the map file location • Strings must start with a letter and can contain a-z, A-Z, 0-9, - and _. All other strings must be quoted. • Order of layers is significant - FIFO.

  17. 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

  18. Basic Layer Object LAYER NAME name GROUP name DATA filename STATUS ON|OFF|DEFAULT TYPE ANNOTATION|POINT|LINE|POLYGON|RASTER|QUERY MINSCALEDENOM n (MAXSCALEDENOM) CLASSITEM column name CLASS …parameters… END LABELITEM column name END

  19. Basic Class Object CLASS NAME full name for legend EXPRESSION string STYLE …parameters… END LABEL …parameters… END TEXT string END

  20. Basic Style Object STYLE ANTIALIAS TRUE|FALSE BACKGROUNDCOLOR r g b COLOR r g b OFFSET dx dy OUTLINECOLOR r g b SIZE n SYMBOL n|name END

  21. Basic Label Object LABEL TYPE BITMAP|TRUETYPE FONT name COLOR r g b OUTLINECOLOR r g b SIZE n|TINY|SMALL|MEDIUM|LARGE|GIANT POSITION UL|CC|LR|…|AUTO ANGLE n|AUTO BUFFER n ANTIALIAS TRUE|FALSE END

  22. Legend Object LEGEND STATUS ON|OFF KEYSIZE x y KEYSPACING x y LABEL …parameters… END IMAGECOLOR r g b END

  23. 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

  24. Reference Map Object REFERENCE STATUS ON|OFF SIZE x y EXTENT minx miny maxx maxy COLOR r g b OUTLINECOLOR r g b IMAGE filename END

  25. This is controlled by the LAYER objects (and sub-objects), and a few MAP level parameters like SIZE and EXTENT. These are controlled by the SCALEBAR object and its LABEL object. Controlled by the REFERENCE object. This is a template AFTER it has been processed by MapServer and returned to the user’s browser. In a nut shell…

  26. Class Object Expressions • Used to group features according to attribute table values • Each layer can have multiple classes each with it’s own expression • 3 expression types supported: string, regex and logical (can mix and match) • Order of classes is significant

  27. String Expressions • Fastest to evaluate, based on pure equality • Denote using quotes • Case sensitive • Attribute identified using CLASSITEM Examples: EXPRESSION “Forest” EXPRESSION “10”

  28. 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 /./

  29. 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

  30. ...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)

More Related