Technological Infrastructures for GIS (TIGIS) Demonstration Web Pages

Demo Pages

Demo Page - Used in Practical 1

Demo Page Images (down one level)

- As a relative link this is a href="demopage/images" (same as the absolute link a href="http://www.geos.ed.ac.uk/~gisteac/tigis/demopage/images/")

Demo Page Images (up one level)

- As a relative link this is a href="demopage/../images_folder_up_one_level" or just images_folder_up_one_level (same as the absolute link a href="http://www.geos.ed.ac.uk/~gisteac/tigis/images_folder_up_one_level/")


Tips for Web Scripting



Practical Web GIS Demo Code

Practical 3/Wk4 - Static HTML

Practical 5/Wk7 - Dynamic CGI Scripting: From DBMS to Web

Practical 6/Wk8 - HTML Form and Javascript URL API WMS Mashups

Practical 7/Wk9 - Leaflet Maps (JS) and Dynamically Generated from Python using Folium; Custom Tilesets from Paper Maps with MapTiler

Practical 8/Wk10 - Producing Maps with MapServer

Extra Reference Practical - Templating with Jinja2 (HTML and Python combined properly)

Note: See extra examples below for more help useful for the assessed project or just to help your learning




Extra Examples - Using Python to read and print HTML streams (incl. handling images)

HTML read by Python script (including images) and printed as an HTML stream to browser (same technique used in wks7, 9 and 10)

Following on from wk 10 we look below at examples of python reading HTML and printing this back to the calling web browser (or other client).

Note: images etc. can be served from within public_html but not outside/above this nor within the cgi-bin sub-folder (or sub-folders within this - imagine cgi-bin as a magic door to another place or as a fenced off special secure area where different rules apply!).

Example python script to read an HTML file and print this as a stream to the browser

These two examples are functionaly identical - one reads a version of the HTML from public_html/tigis while the other reads it from public_html/cgi-bin/tigis/examples. In each case any relative filepaths should be the same since in both cases the working directory is cgi-bin/tigis/examples where each version of the script lives.

Reads HTML from cgi-bin/examples - View Code

Reads HTML from public_html/tigis - View Code

Since in both cases the webpages contain filepaths relative to cgi-bin/tigis (where the script is run from) it makes little sense to view the html natively however you can use View > Source to effectively do this