Presentation is loading. Please wait.

Presentation is loading. Please wait.

GIS and the Internet MapServer Application Development.

Similar presentations

Presentation on theme: "GIS and the Internet MapServer Application Development."— Presentation transcript:

1 GIS and the Internet MapServer Application Development

2 Web Browse Applications


4 MapServer Templates... Defined in the Web Object Can be HTML files or fully qualified URLs HTML files can contain anything including Javascript or Java File templates names must end with.html/.html/.xml/.wml Substitutions in URL templates are escaped, this is not the case with file templates

5 …MapServer Templates Substitution strings delinitiated by [ ]’s Substitutions are case sensitive Escaped versions are retrieved by appending _esc to the parameter [foo_esc] Any parameter passed into the server can be retrieved, that is a variable named foo can be retrieved in template using [foo]

6 Zooming Use zoom: factors from -25 to 25 Use zoomsize/zoomdir in combination –zoomsize: factors from 1 to 25 –zoomdir: -1, 0 or 1 Panning default (zoom = 0/1, zoomdir = 0)

7 Panning Image (0,0) You can create pan tools (images or text) by simulating mouse clicks outside the image. See IMGXY parameter in the online MapServer CGI reference.CGI reference

8 Maintaining State Pass thru CGI vars Layer and zoom replacement strings Javascript Examples: [name_select|check] [zoom_n_select|check] [zoomdir_-1|0|1_select|check]

9 Configuration On-The-Fly Uses object notation to change most mapfile parameters via the CGI interface. Syntax: map_object_parameter. Can access nested and named objects. Examples: map_scalebar_units = km map_water_class_color = 255 255 255 map_roads_class_expression = ([LENGTH] > 400)

10 Web Query Applications

11 Many Modes of MapServer All queries are accompanied by a mode change: query, nquery and many others Extension of a pan/zoom interface, that is, same form variables are used Queries allow you to get at the attributes for a feature(s) and present them via templates

12 Extension to Layer/Class Objects CLASS... TEMPLATE file|url END LAYER... HEADER file FOOTER file TEMPLATE file|url END

13 Query Mode Single result is sought in one or more layers (restrict query using qlayer) Uses point input Uses layer TOLERANCE to determine success or failure for each feature Single template return, as defined in the layer or class object

14 nQuery Mode... Multiple results are sought in one or more layers (restrict query using qlayer) Uses point or area of interest input Uses layer TOLERANCE to determine success or failure for each feature multiple template return, as defined in several places in the map file

15 …nQuery Mode Template parsing sequence: 1) header (web object) 2) layer header (layer object) 3) query template (query object) -- repeat 3) for each feature -- 4) layer footer (layer object) -- repeat 2) to 4) for each layer -- 5) footer (web object)

16 Query Templates Identical to browse templates in concept Add substitutions for attribute values, syntax is [ITEMNAME] and is case sensitive Attributes are HTML-escaped by default, […_raw] and […_esc] versions are available Add substitutions for query result parameters (e.g. number of results, number of layers) Access to shape parameters (e.g. bounding box or centroid)

17 Escaping Let’s say the column NAME contains ‘Lakes & Rivers’: [NAME] outputs ‘Lakes & Rivers’ [NAME_esc] outputs ‘Lakes%20%26%20Rivers’ [NAME_raw] outputs ‘Lakes & Rivers’

18 Other Query Modes ItemQuery - identify features based on attribute values (datasource specific) Feature{n}Query - identify polygon features to use to select against other layers ItemFeature{n}Query - identify polygons using attributes to use against other layers IndexQuery - pull features based on a unique id value (not an attribute)

19 Query Maps Allow visualization of query results QUERYMAP COLOR r g b STATUS ON|OFF SIZE x y STYLE HILITE|SELECTED|NORMAL END

20 Cached Queries Performing query operations can be *very* expensive. It’s possible to cache (i.e. save) a query for future use. Set CGI variable “savequery”, creates a.qy file in the temporary directory. Retrieve query using CGI variable “queryfile” and process as if the query was done from scratch.

Download ppt "GIS and the Internet MapServer Application Development."

Similar presentations

Ads by Google