Keywords: Interactive SVG Map, hiking map
Juliana Williams studied Cartography and Geomediatechnology at the University of Applied Sciences in Munich. She wrote her masters thesis "Interactive Hiking Map of Yosemite National Park" at the Institute of Cartography at the Swiss Federal Institute of Technology (ETH) in Zurich, Switzerland. She is currently working on an SVG based e-learning project at the ETH.
This paper describes a project which provides an interactive online map of Yosemite National Park. A hike can be selected according to certain criteria. The chosen trail is displayed in the map along with a profile and a list of useful information and tips. A gallery of georeferenced photos complements the hiking GIS. The webmapping client is written in SVG and runs in every web browser and operating system supported by the Adobe SVG viewer. Thematic data for the hiking trails and georeferenced photo information is delivered in XML-format. GIS-data was obtained from the USGS and from the National Park Service. The vector data is served by a spatial database and raster data is loaded from OGC WMS services. A level of detail concept, multi-scale datasets and scale-dependent symbology ensure an appealing map design.
2. Architecture of the System
3. Technical Basics
4. Level of Detail
4.2 Label Placement
4.3 Shaded Relief
5.1 Spatial Navigation and Reference
5.2 Infopanel and thematic Navigation
5.4 Photo Gallery
6. More Information
7.1 Further Development Options
The goal of this project was to design a high quality map application for hikers which offers a high level of interactivity and is easy to use. A detailed topographic map as well as information regarding the hike is provided. An additional photo gallery and information on how to get to Yosemite National Park, where to stay and eat and links are also available.
Data for this project was obtained from the USGS and from the National Park Service. The different data sources were compiled and completed within desktop GIS-Systems and reprojected to the final projection system (Datum: NAD83, Projection: UTM, Ellipsoid: GRS80). The vector data was transferred to an open source spatial database (Post-GIS). Orthophotos are directly loaded from the Terraserver Webmapping Service. Additional raster data is also requested from an inhouse WMS.
The application can be viewed online at http://www.carto.net/williams/yosemite/ . To be able to view the site, the Adobe SVG Plugin must be installed, which can be downloaded at http://www.adobe.com/svg/viewer/install .
Figure 1: Client-Server Modell
XML (eXtensible Markup Language) is a simple and very flexible text based format derived from SGML (Standard Generalized Markup Language). It is a meta-markup language which means that it doesn't have fixed tags and elements. This allows data structures to be designed as needed. However, there are strict rules as to how to place tags and where they appear, which element names are valid, how attributes are attached to elements, etc. This allows the development of general purpose XML parsers which can read any XML document. These documents must be well-formed and valid. Documents are checked for validness with a XML schema. This schema defines the element names and the attribute names, the correct nesting and the used datatypes. In this application, XML is used for the trail information and for the photo gallery. This results in an independent changing of data which would allow the application to be used for other regions. [HAROLD2001]
SVG (Scalable Vector Graphics) is a language for describing two-dimensional graphics in XML. Three types of graphic objects are allowed: vector graphic shapes, images and text. These objects can be grouped, styled, transformed and composited into exisiting objects. SVG drawings can be interactive and dynamic. Animations can be defined and triggered either declaratively or by script. [W3C2003]SVG draws vectors which are paths that have a starting and an end point and are defined by Cartesian coordinates. The origin is in the upper left corner of the monitor and the positive y-axis points downward.
Information about the data is directly visible in the code of the SVG files which can be viewed, opened and changed. This has the advantage that one can learn from other people's codes, but it also has the disadvantage that (map)graphics could be copied and misused. In cases where the map is generated automatically and individually from the database and generalized depending on the scale, this is only a small problem. A "Digital Rights Management" for future SVG versions is being considered.
The application was tested in the Adobe SVG-Viewer (version 3 and 6) and in the Apache Batik SVG-Viewer. Neither viewer supports the entire SVG 1.1 specification, but the current functionality already allows a creation of an appealing interactive map application. As a result of missing features, e.g. animation features do not exisit in Apache Batik, parts of the code needed to be forked.
PostgreSQL is a highly developed open source object-relational database management system. It has the following features: complex queries, foreign keys, triggers, views, transactional integrity, multiuser concurrency control.[POSTGRESQL2005] PostGIS is a spatial extenstion of PostgreSQL which supports simple features according to the specifications of the Open GIS Consortium, spatial queries, GIS-analysis functions and spatial indexing of GIS objects.[POSTGIS] In combination with the OGR Library  it can import many popular GIS formats.
PHP (Personal Home Page, Hypertext Preprocessor) is a programming language which can be used in three different ways: server-side scripting, command-line scripting, client-side GUI applications). PHP was originally developed to create dynamic websites. Now, PHP is often used to create XML documents, graphics, Flash animations, PDF files, etc. [LERDORF2002] In this application, PHP is used to extract data from the PostgreSQL database and to create SVG fragments. PHP supports many databases including MySQL, PostgreSQL and Oracle.
Figure 2: Data request and loading using the PostgreSQL database
Figure 3: Schema how a PHP-script extracts data from the database
Open GIS Consortium (OGC) Web Map Service (WMS): A WMS produces maps according to ISO/DIS 19128. This standard defines a map as a portrayal of geographic information as a digital image file which is suited to be displayed on a computer screen. These maps are usually rendered in a raster format, e.g. PNG, GIF or JPEG. They are seldom found as SVG (vector format) or as WebCGM (Web Computer Graphics Metafile, vector format).[OGC]
This is the text of chapter 1.
The symbology of the map is dependent on the level of detail. The complexity of the generalization process and various generalization operators, forces the use of only certain generalization rules: choice of elements, simplification of geometry, classification and assignment of line widths, symbol size and font size. If existant, several scales are used within a single map layer, e.g. the hydrology layer is made up of two datasets with different levels of generalization. When a defined level is exeeded, a different data set is shown. The symbol size, font size, line width, etc. were defined according to the conventional cartographic guidelines. The symbol for bus stops are shown only after a certain scale is reached and the names layer becomes more detailed every time the user zooms further into the map.
The label placement occurs automatically. The table of names is read from the database using a PHP script and placed in the map according to the point coordinates. In this application there are two label types: point (e.g. summit names) and area (e.g. field names). The names are placed using their x and y coordinates. The symbol is scaled to change its size depending on the width of the map. The angle of the symbol, e.g. pass, corresponds to the direction of the trail. If the name belongs to a group other than pass, the symbol for names (an invisible point) is used and placed in the map. As it is a point, a rotation is not needed.
To avoid having the labels overlap with symbols or other text elements or intersect with the map boundary, an algorithm is used to place them correctly according to cartographic guidelines. The labels are placed per default in the upper right hand corner of the symbol. By using the bounding box, it is tested whether the label collides with the border of the map. If it does, the next best position is selected, using the 8 label placement possibilities. The 8 options are tested until the name can be placed completely within the map. The next step is to test whether the label collides with other labels or their symbol. To test this, a bounding box for the text and the symbol is used. If the label cannot be placed despite shifting, it is left out.
Figure 4: Text placement
If the labels are area-related, e.g. meadows, mountain ranges or canyons, other rules are used. The labels are placed by default centered on their point coordinates. It is first tested whether they intersect with the map border. If this is the case they are moved along their x and y axis to see if this problem can be avoided. The text is allowed to be moved at the most in either direction by half the length or height of its bounding box. Otherwise the label is not placed. Again it is tested whether the names collide with one another. By shifting the labels in x and y again, the new position is set. The last option is to not place the label at all. The labels are placed depending on the order in which they are extracted from the data base. For this reason the labels were classified and ordered according to their importance.
The placement is only tested in the 8 defined positions and along the x and y axis. It is also not possible to place curved labels, e.g. along rivers. The computer can only place the labels as told to by the algorithm. The current implementation runs through the whole process only once. A better implementation would use an iterative process and change starting conditions for each iteration. If the lables were placed by hand, there would obviously be better and possibly more placement options. In certain cases it would have been possible to add a label or make one more legible by shifting another label.
In order to be able to distinguish the labels from the map elements, a white halo had to be placed around the letters. As the Adobe SVG viewer has a bug with linestroking around characters in certain coordinate systems, this was done using a dilation filter which is globaly defined in the SVG file. In the Apache Batik viewer a white text stroke is attached to an instance object of the original text element. The cloned text element is placed directly beneath the original element. The font used in this application is Cisalpin. This is a new font designed by Felix Arnold and is especially useful for maps as it runs relatively narrow and can be well read in small font sizes. Even when placed over complex map layers it is still legible.
The relief layer consists of three datasets with different resolutions. The relief shown at the first scale is a handmade relief from the National Park Service. The other two are digital and come from the USGS DTM (30 meter resolution) dataset. Before they were added to the application they were edited with Shadow  and Adobe Photoshop.
With the help of Shadow it was possible to make serious improvements to the Yosemite relief. The light direction was changed in several areas and the gray values in the flat areas were brightened. After using Shadow, Photoshop was used to lighten the entire relief. The relief is supposed to be a discreet basis and not drown out the entire map.
Figure 5: Spatial Navigation
Interactivity plays a major role in this application. The user can give commands and control them individually. As not all of the information can be shown at once, it is set in appropriate places and the user can decide when he wants to see and do what. As a result, the user has the feeling that he is communicating with the system. During his interaction, the user learns how to operate the system and makes more complex queries. It is possible for the user to use spatial navigation to in order to zoom or move from one part of the map to another.
The magnifying glass with the “F” stands for “full screen” and upon a click, the entire map is shown. The following symbol allows the user by clicking and dragging to choose an area in the map he would like to see. The hand symbol allows the user to pan in the map, and the last symbol can be used to redefine the center of the map. All symbols are explained in the statusbar on mouseover. The coordinates of the present position of the mouse in the map or reference map are shown in UTM coordinates and in latitude and longitue. The height can be shown additionally, if the DTM layer is switched on. The scale bar shows the distance in kilometers and miles. In this application it changes proportionally to the zoom scale of the map. If the length is shorter than one kilometer, then meters are shown. This is also true for miles. If the length is shorter than half a mile, the unit is yards.
The various map layers can be switched on and off as desired. These include: hydrology, landcover, contour lines, names, transportation, trails, buildings, geology, shaded relief, orthophoto, DTM (to show Z values). The trails are shown only if the map width is below 12000 meters. The geology and the hydrology map switches from the generalized map to a detailed map at a map width of 10000 and the landcover map switches at a map width of 5000. Legends for the layers hydrology, landcover, names, transportation, geology and features (for the trails) can also be displayed. The geology map has two legends which are dependent on the level of detail.
All data that is triggered by mouseover-events is shown in the infopanel. The contour lines are shown in meters and in feet. The information about the geology is divided into the name and the period of the rock. The information about the buildings are given in name and type of the building. Thematic navigation allows the user to choose from different categories such as trails, photo gallery, general information, links and acknowledgements. The major part of the application (trails and photo gallery) occurs here.
The trails play a major role in this application. The user has the ability to choose a trail by name, difficulty, duration and location. The names are alphabetically sorted. When choosing by difficulty, duration or location, the user is first asked to specify his wishes before being given a filtered list of trails. The list is generated out of an XML-file is filtered by criteria prior to displaying the customized version.
Figure 6: Trail Information
After selecting a trail, its relevent information is displyed. First, the name of the trail and symbols of its features are shown. The feature symbols (rocks, water, nice view, flowers, child friendly) are described in the legend. Following that, the distance, duration and recommended season are stated. Elevation gain and difficulty show how difficult the trail is. Next, information about the location of the trail along with the suggested USGS topographical map(s) (1:24000) and the nearst campground are available. The start and end points of the trail are also mentioned. If there are additional tips and/or links, they are listed last. Lastly, the user can animate the trail and calculate and look at the profile.
Figure 7: Profile
When the user activates “Calculate Profile”, the trail is highlighted and after a computing delay, the profile is displayed. The profile shows elevation levels changing from dark (low elevation) to light (high elevation). In the upper left hand corner the maximum and minimum height along the trail is shown. The scale on the right side of the profile displays the elevation in fixed intervalls. If the mouse is moved along the profile, the position in the map along the trail is shown with a white circle. A line in the profile also shows the position. The information about the height is given in meters and feet in the infopanel.
It is possible for the user to look at photos by choosing a certain category. These categories are: geomorphology, lake/river, meadow, peak, vegetation, view, waterfall, webcams. As some pictures can be sorted into more than one category, they can show up in different categories. After a category has been chosen, thumbnails of the pictures (four at once) are displayed. If there are more than four photos, the user can go to the next page by clicking the arrows on the right. When the user clicks on a photo, it is enlarged. The title, the photographer, the date the picture was taken, the UTM coordinates and the azimuth (if existant) are shown either beneath the photo (landscape format) or to the right of it (portrait format). At the same time the map zooms to the place where the photo was taken (as shown in Illustration 8). Here a camera symbol is placed in the center of the map and looks in the direction the picture was taken.
Figure 8: Georeferenced photo with information
Here the user can find out how to get to Yosemite by air, bus, train or car, where to eat and where to stay. The list of links allows the user to find more information on other websites. Each of the sites open in a separate window.
SVG was well suited for the implementation of the application. A large part of the client application was written in ECMAScript. Without such a client sided programming language it would have been nearly impossible to create such an application. This project can be regarded as one of the first interactive, vectorbased online applications with a database backend. The vectorbasis sets new quality standards for graphic quality and interactivity. The separation between content and presentation, using XML, allows a fast update and adaptation of the application to other regions.
Such an application can never be completely “finished”. All trails must be included with detailed information. The georeferenced photos should be shown along the trail and additional georeferenced information such als swimming possibilities, vista points, etc. would enrich the information system. It is easy to imagine such an application at a visitor center of a National Park which can give hikers and others information about the hiking options. The possibility of printing such a hiking route to take along is desireable. The layout would be easy to adjust to the layout of a National Park.
Another very worthwile addition would be an offline version of this application. That way trails could be searched without the need of an internet connection. The largest problem for such a version would be the spatial database. At the moment there are hardly any geographic databases which can be used by the user without installation or database knowledge.
An additional GPS module could allow the recording of data in the map application. It would also be interesting to be able to use the recorded routes and waypoints interactively.
As it is increasingly popular to integrate navigation functions in mobile devices, it would be imaginable that hikers take their mobile phones or PDAs with them on the hike and consult them along the trail. Such location based services are already popular in Japan. It would be nessessary to redesign the GUI and the map symbology. By utilizing SVG-Tiny or SVG-Basic it would be possible to adapt the application to mobile phones or PDAs.
OGR Library: Open Geometry Referencce
Common Gateway Interface: an intercafe between the webserver and other applications. Parameters are given using wither the methos "Get" (data is encoded in the URL) or "Post" (data is passed by standard input).
Higrid (Hierarchical Grid) was programmed by Dr. Hans-Ruedi Bär at the Institute of Cartography, ETH Zurich
A programm by Bernhard Jenny (Institute of Cartography, ETH Zurich) to locally adjust shading parameters of digital relief shadings
XHTML rendition made possible by SchemaSoft's Document Interpreter™ technology.