|
Home > Avalanche Map > Technical Details Technical DetailsGoalThe goal of the project is to increase the avalanche knowledge of visitors to the area. Google technology makes it possible to combine information in a way that is easy and enjoyable to explore. The hope is that this will make learning as attractive and fun as playing a video game, resulting in improved training and safety. MethodThe Utah Avalanche Map combines information from the Utah Avalanche Center with maps from Google Maps or Google Earth to show where avalanches have been reported. The maps come from Google and the pictures come from the UAC server. The only thing that comes from this server is a small amount of information which connects the larger files from the other two sites. A web site that works this way is called a mashup. Although Google Maps and Google Earth both show maps with overlays of information, there are big differences in how they are controlled. This server has a single database that stores information from avalanche reports, and software to convert that information to the format needed by Google Maps or Google Earth. Both are supported because Google Maps places fewer demands on the user's computer, so is accessible to more people, while Google Earth provides a 3D view of the terrain. Topography is very important in causing avalanches, so the 3D view is more informative. DataThe place names shown on Google Maps and Google Earth do not include unofficial names in common use. Google Maps also omits many of the official names outside cities, and Google Earth omits a few official names. So an important function of the Utah Avalanche Map software is to add place name labels to the maps provided by Google. Place names are stored in three XML files:
Summer hiking trails are important landmarks to the users. Trail information is stored in one XML file, trails.xml Avalanche data comes from the UAC. It is stored in one XML file, avalanches.xml Data ProcessingData must be presented in different formats to Google Maps and Google Earth. Files in the correct format are generated whenever the database is updated. Processing is done by a number of XSLT scripts, some of which call extensions written in Java. The conversion is controlled by Ant and Xalan. Google Maps InterfaceGoogle Maps runs in the user's browser. When a browser visits the Utah Avalanche Map page, that page instructs the browser to load and execute a small JavaScript file, map.js, which controls the map, and another small file, elabel.js (originally from here), used to apply labels to the map. This page also loads from Google a JavaScript file with the Google Maps API library functions. When the browser has finished loading the map page and the various JavaScript files, it calls the load() function at the beginning of map.js. load(), running in the browser, connects to this server and reads three files from it: GMap2UtahPlaces.xml, GMap2UtahTrails.xml and GMap2UtahAvalanches.xml. load() calls the GXml JavaScript functions from the Google Maps library to parse each XML file and uses the information extracted to add overlays to the map. When the load() function finishes, all relevant information has been added to the map. Thereafter the Google JavaScript software running in the browser keeps the overlays in the correct position on the map as the user moves around it. One problem that comes from adding labels to the map is clutter. When the map has many labels, they overlap and become unreadable from a distance. The solution is to assign a "minimum zoom" value to each label. This causes the label to disappear until the user zooms to a certain minimum distance from the label. By choosing minimum zoom values appropriately, only the major landmark labels are visible from a distance. As the viewer zooms in to an area, labels of the minor landmarks become visible. Google Maps currently has only partial support for minimum zoom levels of trails. A trail is passed to Google Maps as an encoded polyline, which adjusts the level of detail to match zoom level, but does not allow the line to completely disappear from the map. The conversion of data from XML to encoded polyline form is performed by this Java program, which is called as an XSLT extension. Google Earth InterfaceGoogle Earth uses a special 3D viewer program that is independent of any normal browser. To add information to the Google Earth map, the user tells the viewer program to load a file written in a special XML dialect called KML (for Keyhole Markup Language). The KML file can be read from either the user's computer or an Internet link. The two KML files that define the Utah Avalanche Map to Google Earth, UtahPlaces.kml and UtahAvalancheMap.kml, are constructed by the XSLT scripts. Then the two KML files are combined into a compressed ZIP archive file called UtahAvalancheMap.kmz, which is made available on the Internet. Download the Data and Software
Last modified: Friday, May 25 2007 at 1:04:04 PM MDT |