WILLIAM M. BROWN, HELENA MITASOVA
Geographic Modeling and Systems Laboratory,
Department of Geography, 220 Davenport Hall,
University of Illinois at Urbana-Champaign, Urbana, IL 61801
LUBOS MITAS
National Center for Supercomputing Applications,
University of Illinois at Urbana-Champaign,
Urbana, IL 61801
Effectiveness of numerical simulations of landcsape processes is significantly influenced by the quality of supporting tools for processing, analysis and visualization of complex input and output fields (Rhyne and others, 1993). The role of visualization has increased in the past 10 years due to the dramatic improvements in hardware and software for computer graphics. Although the term was not defined until the late 1980s, Visualization in Scientific Computing (ViSC) has been used by cartographers since the early beginnings of GIS in the 1960s (Tobler, 1970). Soon, dynamic 3D surfaces appeared in cartographic visualizations (Moellering, 1978; 1980), using a joystick and dials for real time control of viewing parameters rather than today's ubiquitous mouse pointer and graphical user interfaces. While cartographers today can use a wide selection of computing platforms and software solutions for creating sophisticated dynamic 3D visual models (Kennie and McLaren, 1988; Raper, 1989; Nielson and others, 1991; Ervin, 1993; Kraak, 1993; Slocum, 1994; Stephan, 1995), there are still only a few examples of full integration of such visualization and cartographic capabilities within a single GIS providing seamless sharing of data or object types.
Implementation of dynamic landscape simulation has demanded integration of GIS and computer cartography with specially designed scientific visualization ( Brown and Gerdes, 1992: SG3d; Mitasova, Brown, and Hofierka, 1994; Brown and others, 1995; Brown and Astley, 1995: NVIZ), and this integration has proved to be very successful in supporting the development and applications of complex spatio-temporal models. This full integration provides us with methods and interactive tools for efficiently creating dynamic cartographic models representing landscape phenomena and processes.
Dynamic cartographic models are used as either a process of research and discovery (MacEachren and Ganter, 1990; Monmonier, 1990; Openshaw, Waugh, and Cross, 1994) with visualizations feeding a refinement of the model, or as a method of communicating complex measured or modeled geographic phenomena (Brown and others, 1995; Stephan, 1995; Hibbard and Santek, 1989; Hibbard and others, 1994; Fisher, Dykes, and Wood, 1993; Rhyne and others, 1993). This concept is closely related to the range of map use in geographical inquiry defined by DiBiase (1990) with the presented methods and tools supporting both visual thinking and visual communication.
To provide insight into spatial and spatio-temporal relations of studied phenomena, the cartographic models are created using multiple dynamic surfaces and isosurfaces, together with draped raster, vector and point data in an appropriate projection of 3D space. Visual exploration and analysis of data is facilitated by interactive manipulations of visualization environment parameters such as viewing position, z-scale, cutting planes for fence diagrams, light position and brightness etc., and by animating the sequences of images created by changing the viewing parameters or by displaying evolving series of data (Mitasova, Brown and Hofierka, 1994; Brown and others, 1995). Interactive query capabilities, retrieving original attributes directly from the GIS data base, facilitate the modeling process. Integration within the GIS also encourages greater use of all available data due to the ease of data access and manipulation and stimulates interdisciplinary research involving specialists from various disciplines who use GIS to perform different tasks on the same data sets.
In this report we provide an overview of visualization tools developed for GRASS GIS together with examples of their practical applications for visual analysis and communication of complex landscape characterization data and landscape process simulation results.
For our early tools we used IRIS GL, a software interface specific to Silicon Graphics hardware which took full advantage of hardware acceleration to provide the required functionality and offered an easy-to-use programmers' interface.
As the importance of hardware acceleration for common 3D graphics calculations is being recognized by more hardware vendors, standard software interfaces become necessary in order to increase portability of software and standardize expected rendering behavior. Two such standards are the PHIGS extension to X (PEX), and OpenGL. While PEX is a library, OpenGL is a specification for an application programming interface (API)(Neider 1993). As such, it is up to each hardware vendor to provide an implementation of OpenGL which takes advantage of proprietary hardware acceleration. For current development we chose to use OpenGL because we believe that OpenGL implementations are more likely to provide superior performance on a variety of platforms and system configurations.
Tcl/Tk ("Tool Command Language"/"ToolKit"), developed by John Ousterhout, is an X Window System based scripting and widget environment built on Xlib (Ousterhout 1994). Tcl/Tk provides a standard library of common widgets such as menus, buttons and the like, as well as a mechanism for developing arbitrarily complex custom widgets. Moreover, Tcl/Tk provides a natural mechanism for extension by allowing the creation of new commands via scripts or C code. Using this mechanism we have incorporated our visualization library as an extension to Tcl/Tk, allowing users access to visualization tools at the Tcl/Tk level, as well as the ability to extend Tcl/Tk with custom code.
The Tk toolkit provides mechanisms for communicating between applications by sending Tcl commands back and forth. The common Tcl language framework makes it easier for applications to communicate with one another.
GRASS (Geographic Resources Analysis Support System) is a public domain raster based GIS, vector GIS, image processing system, and graphics production system. Written by the US Army Corps of Engineers, it is used extensively at government offices, universities and commercial organizations throughout the world. It is written in C for various UNIX based machines.
Users wishing to write their own code can do so by examining existing source code, interfacing with the documented GIS libraries, and by using the GRASS Programmers' Manual. This allows more sophisticated functionality to be fully integrated within GRASS GIS.
The gsurf library, consisting of approximately 20,000 lines of C code, contains some 180 public functions and about twice as many internal functions for run-time data storage, manipulation, querying, and visualization using OpenGL. The library handles all drawing and lighting operations, including use of user-defined clipping planes and drawing various style "fences" on clipping planes when drawing multiple surfaces, and treats datasets as objects which can be used for various attributes of the rendering. It allows data sharing (e.g., same data for more than one attribute of same or different surfaces), separate masking for each surface, multiple surfaces, vector sets, or point sets, and will also allow multiple volumes. The library provides all query features such as 3D "point on surface", keyframe animation routines, and full state saving functionality. Database-specific routines for interfacing with the GRASS GISlib are kept isolated for easier library reuse with other databases. The gsurf library is not dependent upon any particular interface library, and has been used successfully with both Motif and Tcl/Tk.
The library is designed to provide a unique "handle" or
identifier number to the calling program for each new
geographic object added to the model. The object could
be a surface, vector set, or point set, which could each
be defined by one or more database files. Once created,
the application only needs to keep track of the "handles"
to the objects; e.g., to draw a surface the application
would make the call:
GS_draw_surf(id)
GV_select_surf(vid, sid) GS_alldraw_surf() GV_draw_vect(vid)
Programmers' documentation is currently incomplete, but see the following for more details of the library design and capabilities in the appendix:
GRASS utility programs such as r3.in.ascii, r3.out.ascii, r3.in.grid3 (for our previous simple volume data format), r3.mask, r3.null, r3.info, g3.region were developed using the g3d library for import/export and manipulation of grid3 data (Mitasova and other, 1996b).
The library was robustly designed to deliver important features without being overly complex, at the expense of some efficiency. Current testing has revealed a few bugs and nomenclature inconsistencies which require code revision but no major redesign. We anticipate that as more applications are implemented using the g3d library, we will discover additional opportunities to make the library more useful and efficient.
The new GRASS sites API formalizes and documents a specific format for GRASS site lists, providing for multiple dimensions and multiple typed attributes. By providing this basic functionality, the more complex step of linkage to a database may not be required for many applications, and type checking and field labeling is standardized.
The datetime API may be used to record, manipulate, and perform arithmetic on date and time information. This full-function library of nearly 60 public functions follows ANSI standard X3.51-1975 for specification of dates, times, and timezone information. Arithmetic accuracy to fractions of a second may be performed between any dates and times in the past or future. The datetime library itself is completely independent of GRASS, but there are GISlib routines that read and write GRASS TimeStamps to the database. A TimeStamp is defined as either a single DateTime or two DateTimes which imply a range.
Applications using SG3d may be see at the GRASS visualization site and at Oak Ridge National Laboratory's Clinch River Environmental Restoration Project (Hargrove, 1995), among others ( Mitas & others, 1996) ( Ehlschlaeger & Goodchild, 1994) .
OGL3d is the OpenGL version of Nvision (which still used IRIS GL). It served as a testing bed for the porting of the gsurf library to OpenGL.
NVIZ represents the latest in an evolutionary chain of WYSIWYG tools for 3-D map manipulation. Precursors include SG3d, SG4d and Nvision. The gsurf library has fairly well-defined bounds on functionality: an interface for loading raster, vector and site maps is provided; an interface for querying attributes of each of these types of map is provided; an interface for manipulating camera position and rendering is provided; and an interface for generating animation is provided. The NVIZ C back-end augments the gsurf interface by making it visible to Tcl/Tk code and by creating several structures for organizing map types and their attributes into Tcl/Tk "objects" (see below). The NVIZ Tcl/Tk front-end consists almost exclusively of code for generating the user interface and translating interactions into calls to the underlying libraries.
The NVIZ back-end is encapsulated in a special Tcl/Tk shell called "nvwish". The Tcl/Tk front-end must be executed within this shell in order for NVIZ to work.
NVIZ roughly adheres to the Model-View-Controller (MVC) model for generating a display. Most of the Tcl/Tk front-end implements the "controller". That is, users interface with map objects using widgets implemented by Tcl/Tk scripts. The "model" and "view" are largely implemented by the gsurf library. In particular, all map objects are stored and maintained in the gsurf library. Also, all rendering is handled (when it is requested) by gsurf.
The current implementation works fairly well but will require a few improvements if NVIZ is ever made available for the goal of providing a backplane for user-defined application specific customization. In particular, the interface between gsurf and Tcl/Tk should follow MVC more closely. A callback structure should be developed between gsurf and NVIZ so that model updates may be automatically reflected in the user interface.
Maps are identified in Tcl code using the naming scheme
N<map_type><id>where map_type is one of surf, vect or site and id is an integer unique to each map. Maps are manipulated by giving their name followed by one or more arguments. For example, to draw the map Nsurf1234 you would type:
Nsurf1234 drawinto the nvwish interpreter.
The interface for each map object is defined as follows.
N<map_type><id> <cmd> {<args>}Where cmd options are given on this list of map object commands. Note that some commands are only valid for certain map types.
A similar scheme is used for handling light sources. In particular, a light object is created for each light source. Currently, only one light source is manipulated in NVIZ; however, the capability exists for manipulating multiple light sources. Light sources are represented by commands of the form:
Nlight<id> <cmd>light object commands
Finally, cutplanes are created using the same idea. Cutplanes are accessed with commands of the form:
Ncutplane<id> <cmd>cutplane object commands
The first type of scripting is more involved since a single NVIZ action may cause several interface interactions, all of which need to be recorded. Specifically, since Tcl/Tk interfaces use a callback model, each callback triggered by the user while recording a script must be recorded in the script file. The Tk "bind" command needed to be modified so that the exact scripts which are evaluated during callbacks are also echoed to the scriptfile. In the future, it may be desirable to require each panel to explicitly write information to the script file (as is the current implementation of "save state") rather than rely on recording callback invocations.
Probably the most complicated part of the Tcl/Tk front-end is the mechanism for handling scripts. Script playback is the same for either type of script. In general, script playback is difficult because some script actions cause NVIZ to wait for a user response but the appropriate response is contained in the script file. That is, NVIZ expects a response from the keyboard or mouse but instead the response will originate from the script file. Generally, when NVIZ is waiting for a response it suspends all other actions except for X event processing. This means that script playback will suspend if the same process is both reading commands from a script and executing them in NVIZ.
To get over the various difficulties associated with NVIZ waiting for events, we take advantage of the Tk "send" command in order to decouple NVIZ from script playback. The idea is that script commands are sent to a running NVIZ process by a separate script reading process. Commands sent in this fashion are translated to X events which the NVIZ process will interpret even if it is suspended waiting for a user response. In fact, NVIZ is fooled into believing it has received a user response since it cannot distinguish sent events from those generated by the user.
XGANIM loads a specified series of GRASS raster images and then animates the series, with control options presented to the user for speed, looping, direction of play, etc. Up to four distinct series of files may be animated simultaneously. This example animation shows three series representing 1) rainfall, 2) water depth, and 3) soil infiltration during a rainstorm event on a slope. XGANIM is not dependent on OpenGL - all graphics are done using X and Motif.
Also see the appendix
for the xganim user's manual and an image
of the program in use.
P.VRML (Brown, 1996a) is a GRASS map output program which uses GRASS data to generate 3D geometric objects in the format of Virtual Reality Modeling Language (VRML v1.0), for viewing on the World Wide Web. Such output provides collaborating researchers with the capability to explore terrain as a 3D surface without the need to install specialized software other than a VRML capable browser.
Future enhancements will utilize the VRML 2.0 format to compress file size created, and may allow the inclusion of other GRASS data types such as vector and site data. VRML also provides mechanisms to code specific viewpoints or paths and embed WWW links within the objects.
Also see the appendix
for the p.vrml user's manual.
D.SITER (Mitasova and others, 1996) utilizes the new GRASS Sites API and format to interactively display a subset of site data based on selected ranges for attribute values. It uses Tcl/Tk to present a user-friendly GUI with labeled sliders for selection of the various attribute ranges. With d.siter, a researcher may quickly browse multi-attribute site data such as well logs to get a better feel for spatial trends or data anomalies. Subsets defined by selected ranges of attributes may be visualized using various marker sizes, shapes, and colors. Subsets may also be saved to a new sites file.
The program is actually a Unix shell script which calls s.info to determine the number, types and ranges of site attributes, then calls a tcl script which presents a user interface and builds a query string from user interaction, and submits the query to the program d.sites.qual which displays the chosen subset of sites in a GRASS display monitor.
Future enhancements might include methods of visualizing statistical properties of site attributes such as quartiles, standard deviation, skewness, etc.
R3.MKDSPF creates a display file from an existing grid3 file according to specified threshold levels. The display file is a display list of polygons that represent isosurfaces of the data volume. (also see dspf library)
Future use will probably be restricted to batch processing or preprocessing huge datasets, since the capability of r3.mkdspf will be built into NVIZ.
Also see the appendix
for the r3.mkdspf user's manual.
Given a 3D volume in GRASS grid3 format and a display file created using r3.mkdspf, r3.showdspf opens a graphics window and presents the user with many drawing options for representing or animating isosurface representations of the data. (also see dspf library)
Currently we are using r3.mkdspf and r3.showdspf to debug the g3d library and port the graphics of r3.showdspf to OpenGL prior to incorporation of all functionality into NVIZ. In the future, most of the capability of r3.showdspf will be built into NVIZ, but in some cases scripting will be easier using r3.showdspf so we anticipate that it will continue to be supported.
Also see the appendix
for the r3.showdspf user's manual.
The following volume visualization methods will be incorporated:
Model of soil horizons was created by interpolating horizons from 3D point data. We present also a long term land use map to allow visual comparison of distribution of chemicals and land use.
The comparison of the following 3D models of soil properties demonstrate the impact of land use on spatial distribution of chemicals in soil.
a) soil reaction: ph (Fig. 3)
and by blended cutting planes
isosurfaces
planes
slicing fence diagram (row=40,80,120,160)
Volume model incorporates the vertical relationship into interpolation and allows more efficient visual analysis
The highest acidity is on terrain surface in grass area and it extends over most of the area in deeper horizons
b) organic carbon
The highest concentration of organic matter is in the long term grass area. The amount of organic matter rapidly decreases with depth.
c) plant available K
The study area has surplus of Potassium with maximum concentrations in permanent grass locations which indicates its function as a filter or accumulation area. Concentrations decrease with depth, except for a hop field in valley where the higher concentrations extend well bellow the A horizon.
d) plant available P
Area has surplus of Phosphates, with maximum concentrations in valleys (depressions). Concentrations decrease with depth. (Fig. 2)
Location of optimal and surplus K, P presented as intersection of complex solid bodies
Note that the optimal concentrations od K,P cover only a small surface area and, especially for K, they are located mostly bellow surface in lower horizons.
e) total nitrogen
f) bulk density
The values of hydraulic conductivity were derived for each 3D point based on the particle size distribution using equations from the WEPP manual. The values were then interpolated to a 3D raster which can be used as an input for 3D infiltration model or visualized using isosurfaces or crossections:
These examples demonstrate the extension of modern computer cartography from a tool for automatization of paper map production towards providing methods and techniques aimed at exploration and communication of complex georeferenced data and their spatial and spatio-temporal relationships.
Further development and wider applications of the presented cartographic visualization techniques will be driven by full integration of multi-dimensional data structures and their support within GIS, by larger volumes of spatio-temporal data available and by improvements in speed and quality of graphics on personal computers (at least to the level now available only on graphical workstations). While visualization cannot and does not solve the landscape simulation problems which require improvement of algorithms and extensive field experiments for calibration, visualization methods enable researchers to better understand the processes and identify potential errors and solutions.
Brown, W. M., 1996a, VRML translator for GRASS 4.2: p.vrml : Geographic Modeling and Systems Laboratory, Univ. Illinois at Urbana-Champaign, Illinois: http://www.cecer.army.mil/grass/viz/pvrml.man.html.
Brown, W. M., 1996b, SG3d - supporting information. Enhancements for GRASS 4.2: : Geographic Modeling and Systems Laboratory, Univ. Illinois at Urbana-Champaign: http://www.cecer.army.mil/grass/viz/sg3d42.html.
Brown, W. M., and Astley, M., 1995, NVIZ tutorial: Geographic Modeling and Systems Laboratory, Univ. Illinois at Urbana-Champaign, Illinois: http://www.cecer.army.mil/grass/viz/nviz.tut.html.
Brown, W. M., Astley, M., Baker, T., and Mitasova, H., 1995, GRASS as an integrated GIS and visualization environment for spatio-temporal modeling: Proc. Auto-Carto 12, Charlotte, North Carolina, p. 89-99.
Brown, W. M., and Gerdes, D. P., 1992, SG3d - supporting information: U.S. Army Corps of Engineers, Construction Engineering Research Laboratories, Champaign, Illinois: http://www.cecer.army.mil/grass/viz/sg3d.html.
DiBiase, D., 1990, Visualization in the earth sciences: Earth and Mineral Sciences, v. 59, no. 2, p. 13-18.
Ehlschlaeger, C. R. and Goodchild, M. F., 1994, Uncertainty in Spatial Data: Defining, Visualizing, and Managing Data Errors: Proceedings of GIS/LIS 1994, pp. 246-53, Phoenix AZ. http://geo.swf.uc.edu/~chuck/gislis/gislis.html
Ervin, S. M., 1993, Landscape visualization with Emaps: IEEE Computer Graphics and Applications: v. 13, no. 2, p. 28-33.
Fisher, P., Dykes, J., and Wood, J., 1993, Map design and visualization: Cartographic Jour., v. 30, no. 12, p. 136-142.
Hargrove, W., Hoffman, F., and Levine, D., 1995, Clinch river environmental restoration program: http://www.esd.ornl.gov/programs/CRERP/.
Hibbard W. L., Paul B. E., Battaiola A. L., Santek D. A., Voidrot-Martinez M.-F., and Dyer C. R., 1994, Interactive visualization of earth and space science computations: Computer, v. 27, no. 7, p. 65-72: http://www.ssec.wisc.edu/~billh/vis.html
Hibbard, W. L., and Santek, D. A., 1989, Visualizing large data sets in the earth sciences: Computer, v. 22, no. 8, p. 53-57.
Kennie, T. J. M., and McLaren, R. A., 1988, Modelling for digital terrain and landscape visualization: Photogrammetric Record, v. 12, no. 72, p. 711-745.
Kraak, M. J., 1993, Cartographic terrain modeling in a three-dimensional GIS environment: Cartography and Geographic Information Systems, v. 20, no. 1, p. 13-18.
MacEachren, A. M., and Ganter, J. H., 1990, A pattern identification approach to cartographic visualization: Cartographica, v. 27, no. 2, p. 64-81.
Mitas, L., Mitasova, H., Brown, W. M., and Astley, M., 1996, Interacting fields approach for evolving spatial phenomena: application to erosion simulation for optimized land use: Proc. III. Intern. Conf. on Integration of Environmental Modeling and GIS, Santa Fe, New Mexico, by National Center for Geographic Information and Analysis, Santa Barbara CA, CD-ROM and WWW: http://www.cecer.army.mil/grass/viz/SF.final/mitas.html
Mitas, L., Brown, W. M., and Mitasova, H., 1997, Role of Dynamic Cartography in Simulations of Landscape Processes Based on Multivariate Fields: Computers & Geosciences, v. 23, no. 4, p. 437-446. http://www.elsevier.nl/inca/homepage/sad/cageo/mitas/mitas.htm
Mitasova, H., Brown, W. M., Johnston, D. M., Saghafian, B., Mitas, L., and Astley, M., 1995, GIS Tools for Erosion/deposition Modeling and Multidimensional Visualization, part I: Interpolation, Rainfall-runoff, Visualization: Report for USA CERL, Univ. Illinois at Urbana-Champaign, Illinois, 45 p.
Mitasova, H., Brown, W. M., Johnston, D. M., and Mitas, L., 1996, GIS Tools for Erosion/Deposition Modeling and Multidimensional Visualization, part II: Unit Stream Power-based Erosion/deposition Modeling, and Enhanced Dynamic Visualization. Report for USA CERL, Univ. Illinois at Urbana-Champaign, Illinois, 38 p.
Mitasova, H., Mitas, L., Brown, W. M., Johnston, D. M., 1996b. GIS Tools for Erosion/Deposition Modeling and Multidimensional Visualization, part III: Process-based Erosion Simulation: Report for USA CERL, Univ. Illinois at Urbana-Champaign, Illinois, 34 p.
Moellering, H., 1978, A demonstration of the real time display of three dimensional cartographic objects: computer-generated video tape, Department of Geography, Ohio State University.
Moellering, H., 1980, The real-time animation of three dimensional maps: American Cartographer, v. 7, no. 1, p. 67-75.
Monmonier, M., 1990, Strategies for the visualization of geographical time series data: Cartographica, v. 27, no. 1, p. 30-45.
Nielson, G. M., Foley, T. A., Hamann, B., and Lane, D., 1991, Visualizing and modeling scattered multivariate data: IEEE Computer Graphics and Applications, v. 11, no. 3, p. 47-55.
Openshaw, S., Waugh, D., and Cross, A., 1994, Some ideas about the use of map animation as a spatial analysis tool, in Hearnshaw, H. M., and Unwin, D. J., eds., Visualization in Geographical Information Systems: John Wiley & Sons, Chichester, p. 131-138.
Raper, J., Ed., 1989, Three dimensional applications in geographical information systems: Taylor & Francis, London, 254 p.
Rhyne, T., Bolstad, M., Rheingans, P., Petterson, L., and Shackelford, W., 1993, Visualizing environmental data at the EPA: IEEE Computer Graphics and Applications, v. 13, no. 2, p. 34-38.
Schmidt, K. E., and Ceperley, D. M., 1992, Monte Carlo techniques for quantum fluids, solids and droplets, in Binder, K., ed., Monte Carlo Methods in Statistical Physics III: Springer, Berlin, p. 205-248.
Slocum, T. A., 1994, Visualization software tools, in MacEachren, A. M., and Taylor, D. R. F., eds., Visualization in Modern Cartography: Pergamon, Oxford, p. 91-94.
Stephan, E. M., 1995, Exploratory data visualization of environmental data for reliable integration: Proc. Auto-Carto 12, Charlotte, North Carolina, p. 100-109.
Tobler, W., 1970, Computer movie simulating urban growth in the Detroit region: Economic Geography, v. 46, p. 234-240.