--- grass-6.0.1.orig/config.guess +++ grass-6.0.1/config.guess @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -timestamp='2004-08-13' +timestamp='2005-04-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -53,7 +53,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -319,6 +319,9 @@ *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; @@ -342,7 +345,7 @@ DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; @@ -801,6 +804,9 @@ i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; + amd64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; @@ -824,6 +830,12 @@ cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit 0 ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -1128,6 +1140,10 @@ # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos @@ -1188,6 +1204,9 @@ *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; @@ -1241,7 +1260,10 @@ A*) echo alpha-dec-vms && exit 0 ;; I*) echo ia64-dec-vms && exit 0 ;; V*) echo vax-dec-vms && exit 0 ;; - esac + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1401,7 +1423,9 @@ the operating system you are using. It is advised that you download the most up to date version of the config scripts from - ftp://ftp.gnu.org/pub/gnu/config/ + http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess +and + http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub If the version you run ($0) is already up to date, please send the following data and any information you think might be --- grass-6.0.1.orig/config.sub +++ grass-6.0.1/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -timestamp='2004-06-24' +timestamp='2005-04-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -70,7 +70,7 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -231,13 +231,14 @@ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | m32r | m32rle | m68000 | m68k | m88k | mcore \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -262,12 +263,13 @@ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ - | x86 | xscale | xstormy16 | xtensa \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; @@ -298,7 +300,7 @@ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ - | bs2000-* \ + | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ @@ -310,7 +312,7 @@ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -336,15 +338,16 @@ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; @@ -457,6 +460,9 @@ crds | unos) basic_machine=m68k-crds ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; @@ -486,6 +492,10 @@ basic_machine=m88k-motorola os=-sysv3 ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx @@ -1026,6 +1036,10 @@ basic_machine=hppa1.1-winbond os=-proelf ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; xps | xps100) basic_machine=xps100-honeywell ;; @@ -1294,6 +1308,9 @@ -kaos*) os=-kaos ;; + -zvmoe) + os=-zvmoe + ;; -none) ;; *) --- grass-6.0.1.orig/db/base/db.columns.tmp +++ grass-6.0.1/db/base/db.columns.tmp @@ -0,0 +1,37 @@ +

DESCRIPTION

+ +db.columns lists all columns for a give table. Connection to +databases are supported through dbf, shp, odbc and pg drivers. + +

NOTE

+ +If parameters for database connection are already set with +db.connect, they are taken as default values and +do not need to be spcified each time. + +

EXAMPLE

+ +List columns from PostgreSQL attribute table
+db.columns table=markveggy driver=odbc +database=grass51test + +

+ +If database parameters are already set
+db.columns table=markveggy + +

+ +List columns from Shape file with DBF attribute table
+db.columns table=network driver=dbf +database=/daten/grassdata/fire/PERMANENT/dbf/ + +

SEE ALSO

+db.connect, db.createdb, db.databases, db.describe, db.drivers, db.dropdb, db.droptable, db.execute, db.tables + +

AUTHOR

+ +Radim Blazek, ITC-Irst, Trento, Italy +
+

Help Index + --- grass-6.0.1.orig/db/base/db.select.tmp +++ grass-6.0.1/db/base/db.select.tmp @@ -0,0 +1,37 @@ +

DESCRIPTION

+ +db.select prints result of selection from database +based on SQL statement read from input file or from standard input +to standard output. + +

NOTE

+ +If parameters for database connection are already set with +db.connect, they are taken as default values and +do not need to be spcified each time. Output will be displayed to stdout or can +be directed to a file. + +

EXAMPLES

+ +echo "select * from roads" | db.select +
or
+cat file.sql | db.select + +

+ +Select all from table roads
+db.select -c driver=odbc database=g51test +table=roads sql=file.sql > result.csv + +

SEE ALSO

+ +GRASS 5.1 +tutorial pages, db.connect
+ +

AUTHOR

+?
+Modifications: Radim Blazek, ITC-Irst, Trento, Italy + +
+

Help Index + --- grass-6.0.1.orig/db/base/db.tables.tmp +++ grass-6.0.1/db/base/db.tables.tmp @@ -0,0 +1,29 @@ +

DESCRIPTION

+ +db.tables lists all tables for a given database. + +

NOTE

+ +If parameters for database connection are already set with +db.connect, they are taken as default values and +do not need to be spcified each time. + +

EXAMPLES

+ +List all tables if database connection is already set
+db.tables -p + +

+ +List all tables of existing dbf database
+db.tables driver=dbf +database=/home/user/grassdata/fire/PERMANENT/dbf + +

SEE ALSO

+db.columns, db.createdb, db.databases, db.dropdb, db.droptable, db.execute + +

AUTHOR

+? +
+

Help Index + --- grass-6.0.1.orig/db/base/db.execute.tmp +++ grass-6.0.1/db/base/db.execute.tmp @@ -0,0 +1,50 @@ +

DESCRIPTION

+ +db.execute allows the user to execute SQL statements. + +

NOTE

+ +If parameters for database connection are already set with +db.connect, they are taken as default values and +do not need to be spcified each time. + +

EXAMPLES

+ +Create a new table with columns 'cat' and 'soiltype':
+echo 'create table soils ("cat" int, "soiltype" text)' | db.execute +
or
+cat file.sql | db.execute + +

+ +Create a new table using a file with sql statements:
+db.execute driver=odbc database=g51test +input=file.sql + +

+Update attribute entries to new value based on SQL rule:
+echo "UPDATE roads SET travelcost=5 WHERE cat=1" | db.execute + +

+Add new column to attribute table:
+echo "ALTER TABLE roads ADD COLUMN length double" | db.execute + +

SEE ALSO

+GRASS 5.7 +tutorial pages, +db.columns, +db.createdb, +db.databases, +db.describe, +db.drivers, +db.dropdb, +db.droptable, +db.tables + +

AUTHOR

+ +CERL + +
+

Help Index + --- grass-6.0.1.orig/db/base/db.droptable.tmp +++ grass-6.0.1/db/base/db.droptable.tmp @@ -0,0 +1,59 @@ + + + +db.droptable + + + +

NAME

+db.droptable - Remove a table from database. +

SYNOPSIS

+db.droptable
+db.droptable help
+db.droptable table=string [driver=string] [database=string] + + +

Parameters:

+
+
table=string +
table name
+ +
driver=string +
driver name
+
Options: pg,dbf,ogr,shp,odbc
+ +
database=string +
database name
+ +
+

DESCRIPTION

+ +db.droptable removes an existing database table. + +

NOTE

+ +If parameters for database connection are already set with +db.connect, they are taken as default values and +do not need to be spcified each time. + +

EXAMPLE

+ +Remove an existing attribute table connected through odbc
+db.droptable table=test driver=odbc +database=g51test + +

+ +Remove attribute table with if database connection is set with db.connect
+db.droptable table=test + +

SEE ALSO

+ +db.createdb, db.databases, db.describe, db.droptable, db.execute, db.tables + +

AUTHOR

+ +Radim Blazek, ITC-Irst, Trento, Italy +
+

Help Index + --- grass-6.0.1.orig/db/base/db.describe.tmp +++ grass-6.0.1/db/base/db.describe.tmp @@ -0,0 +1,49 @@ +

DESCRIPTION

+ +db.describe displays table information. If parameter -c is used + only column names instead of full column descriptions is given. + +

NOTE

+ +If parameters for database connection are already set with +db.connect, they are taken as default values and +do not need to be spcified each time. + +

EXAMPLE

+ +db.describe -c table=test driver=dbf +
+ncols:2
+Column 1: CAT
+Column 2: BACK
+Column 3: TIME
+
+ +db.describe table=test +
+column:CAT
+description:
+type:INTEGER
+len:11
+scale:0
+precision:10
+default:0
+nullok:yes
+select:yes
+update:yes
+
+[...]
+
+ +

SEE ALSO

+ +GRASS 5.1 +tutorial pages, +db.columns, db.databases, db.dropdb, db.droptable, db.execute, db.tables + +

AUTHOR

+ +Radim Blazek, ITC-Irst, Trento, Italy +
+

Help Index + --- grass-6.0.1.orig/db/base/db.drivers.tmp +++ grass-6.0.1/db/base/db.drivers.tmp @@ -0,0 +1,37 @@ + + + +db.drivers + + + +

NAME

+db.drivers - List all database drivers. +

SYNOPSIS

+db.drivers
+db.drivers help
+db.drivers [-fp] +

Flags:

+
+
-f +
Full output
+ +
-p +
print tables and exit
+ +
+ +

DESCRIPTION

+ +db.drivers lists all database drivers. + +

SEE ALSO

+db.connect, db.createdb, db.databases, db.describe, db.drivers, db.dropdb, db.droptable, db.execute, db.tables + +

AUTHOR

+ +Radim Blazek, ITC-Irst, Trento, Italy + +
+

Help Index + --- grass-6.0.1.orig/db/base/db.copy.tmp +++ grass-6.0.1/db/base/db.copy.tmp @@ -0,0 +1,35 @@ +

DESCRIPTION

+ +db.copy allows the user to copy a table between two databases. Databases +can be connected through different drivers (see example). + +

NOTES

+ +Attribute tables can be copied manually using db.copy and +v.db.connect. Current connection +settings are saved in $LOCATION/vector_map/dbln. + +

EXAMPLE

+ +storing table 'markveggy.dbf' (in current directory) into PostgreSQL +through ODBC:
+db.copy from_driver=dbf from_database=./ +from_table=markveggy to_driver=pg +to_database="host=pgserver,dbname=grass51test,user=neteler" +to_table=markveggy + +

SEE ALSO

+ +GRASS 5.1 +tutorial pages
+v.db.connect
+db.drivers
+db.databases
+v.clean + +

AUTHOR

+ +Radim Blazek, ITC-Irst, Trento, Italy +
+

Help Index + --- grass-6.0.1.orig/db/base/db.connect.tmp +++ grass-6.0.1/db/base/db.connect.tmp @@ -0,0 +1,40 @@ +

DESCRIPTION

+ +db.connect allows the user to set parameters for +connection to database. These parameters are then taken by +modules as default values and user do not need enter +parameters each time. Values are stored in user file. + + +

OPTIONS

+ +Typing db.connect -p displays current connection parameters. + +

EXAMPLE

+ +DBF:
+db.connect driver=dbf database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/'
+db.connect -p +

+ODBC:
+db.connect driver=odbc database=gtest
+db.connect -p +

+PostgreSQL:
+db.connect driver=pg database="host=myserver.itc.it,dbname=mydb,user=name"
+db.tables -p + +

SEE ALSO

+ +db.columns
+db.drivers
+db.databases
+db.tables + +

AUTHOR

+ +Radim Blazek, ITC-Irst, Trento, Italy + +
+

Help Index + --- grass-6.0.1.orig/display/drivers/PNG/pngdriver.html +++ grass-6.0.1/display/drivers/PNG/pngdriver.html @@ -0,0 +1,3168 @@ + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + + + + + PNG driver + + + + +

NAME

+ PNG driver - driver to create PNG images +
(drivers) +

DESCRIPTION

+ +The PNG driver generates PNG images from GRASS display commands. +

USAGE

+

Environment variables

+Several environment variables effect the operation +of the PNG driver. + + +

Example

+
    +
  1. Start up the driver
    +         d.mon start=PNG
    +         d.mon select=PNG
    +
    +
  2. Display raster map and vector polygons
    +
    +         d.rast somerastermap
    +         d.vect map=somevectormap color=red
    +
    +
  3. Stop the driver subsequently. This will write a +file named map.png to be created in your current directory: +
    +         d.mon stop=PNG
    +
  4. + +
+ +

NOTES

+ +The PNG driver uses the libpng (see the libpng home page) and zlib (see +the info-zip home +page), all which needs to be installed for the PNG driver to work (it's +worth it). +

+The resolution of the PNG raster map is defined by the map +extents. Use g.region -p to get the number of rows and cols and +use the environment variables to set the PNG size. If you would like a +larger image, multiply both rows and cols by the same whole number to +preserve the aspect ratio.

+ +

SEE ALSO

+ +HTMLMAP driver, +celldriver, +XDRIVER, +d.area, +d.mon, +d.vect + + +

AUTHOR

+Original version: Per Henrik Johansen
+phj@norgit.no
+NORGIT AS +

+Rewritten by Glynn Clements, 2003 +

Last changed: $Date: 2004/04/13 09:55:11 $ +


+

Help Index + --- grass-6.0.1.orig/display/drivers/XDRIVER/XDRIVER24/xdriver.html +++ grass-6.0.1/display/drivers/XDRIVER/XDRIVER24/xdriver.html @@ -0,0 +1,1908 @@ +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + +

NAME

+ +XDRIVER - GRASS Monitor - driver to display GRASS maps in +X11 environment
+(drivers) +

DESCRIPTION

+ +The GRASS XDRIVER can be used to display GRASS maps in X11 environment. + +

Usage in details

+ + + + + +To control the XDRIVER, use the d.mon module. +

+The maximum color depth depends on the current X Server settings. + +

SEE ALSO

+g.region, +d.mon, +htmlmapdriver, +celldriver, +PNGdriver +
+ +

AUTHOR

+CERL
+various improvements from several authors.
+Rewritten 2001 by Glynn Clements + +

Last changed: $Date: 2004/01/25 13:56:19 $ +


+

Help Index + --- grass-6.0.1.orig/general/g.parser/g.parser.html +++ grass-6.0.1/general/g.parser/g.parser.html @@ -0,0 +1,148 @@ + + + +test.sh + + + +

NAME

+test.sh - g.parser test script +

SYNOPSIS

+test.sh
+test.sh help
+test.sh [-f] raster=string vector=string option1=string + +

Flags:

+
+
-f +
a flag
+ +
+ +

Parameters:

+
+
raster=string +
raster input map
+ +
vector=string +
vector input map
+ +
option1=string +
an option
+ +
+

DESCRIPTION

+ +The command provides full parser support for GRASS scripts. +

+ +

OPTIONS

+ +The arguments are stored in environment variables, named +GIS_FLAG_<name> for flags and GIS_OPT_<name> for options. + +For flags, the value will be "1" if the flag was given, and "0" +otherwise. +

+ +

+#!/bin/sh
+
+# g.parser demo script
+
+#%Module
+#%  description: g.parser test script   
+#%End
+#%flag
+#%  key: f
+#%  description: a flag
+#%END
+#%option
+#% key: raster
+#% type: string
+#% gisprompt: old,cell,raster
+#% description: raster input map
+#% required : yes
+#%end
+#%option
+#% key: vector
+#% type: string
+#% gisprompt: old,vector,vector
+#% description: vector input map
+#% required : yes
+#%end
+#%option
+#% key: option1
+#% type: string
+#% description: an option
+#% required : yes
+#%end
+
+if [ "$1" != "@ARGS_PARSED@" ] ; then
+  exec $GISBASE/etc/bin/cmd/g.parser "$0" "$@"
+fi
+
+#add your code here
+echo ""
+if [ $GIS_FLAG_f -eq 1 ] ; then
+  echo "Flag -f set"
+else
+  echo "Flag -f not set"
+fi
+
+#test if parameter present:
+if [ "$GIS_OPT_option1" != "(null)" ] ; then
+  echo "Value of GIS_OPT_option1: '$GIS_OPT_option1'"
+fi
+
+echo "Value of GIS_OPT_raster: '$GIS_OPT_raster'"
+echo "Value of GIS_OPT_vect: '$GIS_OPT_vector'"
+
+#add your code here
+
+ +

+The test.sh script will provide following help text: +

+

+./test.sh --help
+
+Description:
+ g.parser test script
+ 
+Usage:
+ test.sh [-f] option=name
+ 
+Flags:
+  -f   a flag
+ 
+Parameters:
+  option   an option
+
+ +

NOTES

+ +An option can be instructed to allow multiple inputs by adding the following line: +
#% multiple : yes
+While this will only directly change the Usage section of the help +screen, the option's environmental string may be easily parsed from within +a script. For example, individual comma separated identities for an option +named "input" can be parsed with the following Bash shell code: + +
IFS=,
+for opt in $GIS_OPT_input ; do
+	... "$opt"
+done
+
+ +

SEE ALSO

+ +g.findfile + +

AUTHOR

+ +Glynn Clements +

Last changed: $Date: 2004/04/19 08:01:41 $ +


+

Help Index + --- grass-6.0.1.orig/lib/gis/mapset_msc.c +++ grass-6.0.1/lib/gis/mapset_msc.c @@ -132,4 +132,3 @@ return 1; } - --- grass-6.0.1.orig/raster/r.terraflow/r.terraflow.html +++ grass-6.0.1/raster/r.terraflow/r.terraflow.html @@ -0,0 +1,11520 @@ +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + +

NAME

r.terraflow - computation of flow +direction, flow accumulation and other basic topographic terrain +indices from a raster digital elevation model (DEM). + +

(GRASS Raster Program) + +

SYNOPSIS

+r.terraflow +
+r.terraflow help
+
+r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + +

DESCRIPTION

+ +

r.terraflow takes as input a raster digital elevation +model (DEM) and computes the flow direction raster and the flow +accumulation raster, as well as the flooded elevation raster, +sink-watershed raster (partition into watersheds around sinks) and tci +(topographic convergence index) raster. + +

r.terraflow computes these rasters using well-known +approaches, with the difference that its emphasis is on the +computational complexity of the algorithms, rather than on modeling +realistic flow. r.terraflow emerged from the necessity of +having scalable software able to process efficiently very large +terrains. It is based on theoretically optimal algorithms developed +in the framework of I/O-efficient algorithms. r.terraflow +was designed and optimized especially for massive grids and is able to +process terrains which were impractical with similar functions +existing in other GIS systems. + +

Flow directions are computed using either the MFD (Multiple Flow +Direction) model or the SFD (Single Flow Direction, or D8) model, +illustrated below. Both methods compute downslope flow directions by +inspecting the 3-by-3 window around the current cell. The SFD method +assigns a unique flow direction towards the steepest downslope +neighbor. The MFD method assigns multiple flow directions towards all +downslope neighbors. + +

+ + + + + +
[SFD] +[SFD] +
Flow direction to steepest
downslope neighbor (SFD).
Flow direction to all
downslope neighbors (MFD).
+ + +

The SFD and the MFD method cannot compute flow directions for +cells which have the same height as all their neighbors (flat areas) +or cells which do not have downslope neighbors (one-cell pits). +

+ +

In order to flood the terrain, r.terraflow identifies all +sinks and partitions the terrain into sink-watersheds (a +sink-watershed contains all the cells that flow into that sink), +builds a graph representing the adjacency information of the +sink-watersheds, and uses this sink-watershed graph to merge +watersheds into each other along their lowest common boundary until +all watersheds have a flow path outside the terrain. Flooding produces +a sink-less terrain in which every cell has a downslope flow path +leading outside the terrain and therefore every cell in the terrain +can be assigned SFD/MFD flow directions as above. + +

Once flow directions are computed for every cell in the terrain, +r.terraflow computes flow accumulation by routing water using +the flow directions and keeping track of how much water flows through +each cell. + +r.terraflow also computes the tci raster (topographic convergence +index, defined as the logarithm of the ratio of flow accumulation and +local slope). + +

For more details on the algorithms see [1,2,3]. + + +

OPTIONS

+ +The program will run non-interactively if the user specifies program +arguments and flag settings on the command line using the following +form: + +

r.terraflow [ -sq ] +elev=name +filled=name +direction=name +swatershed=name +accumulation=name +tci=name +[d8cut=value] +[memory=value] +[STREAM_DIR=name] +[stats=name] + + + +

Alternatively, the user can simply type r.terraflow on the +command line and the program will ask for parameter values and flag +settings interactively, using the standard GRASS parser interface. + + +

Flags:

+
+
-s +
Use SFD (D8) flow. By default MFD flow is used. +
-q +
Run quietly (do not display status messages). By default +r.terraflow is run verbosely.
+ + +

Parameters:

+
+
elev=name +
Input elevation raster. Required.
+ +
filled=name +
Output filled (flooded) elevation raster. Required.
+ +
direction =name +
Output flow direction raster. Required.
+ +
swatershed =name +
Output sink-watershed raster. Required.
+ +
accumulation =name +
Output flow accumulation raster. Required.
+ +
tci =name +
Output topographic convergence index (tci) raster. Required.
+ +
[d8cut =value] +
If flow accumulation of a cell is larger than this value, then +the flow of this cell is routed to its neighbors using the SFD (D8) +model. This option affects only the flow accumulation raster and is +meaningfull only for MFD flow (i.e. if the -s flag is not used); If +this option is used for SFD flow it is ignored. The default value of +d8cut is infinity.
+ +
[memory =value (in MB)] +
The main memory size (in MB) to be used by +r.terraflow. In practice value should be an +underestimate of the amount of available (free) main memory on the +machine. r.terraflow will use at all times at most this much +memory, and the virtual memory system will never be in use. The +default value is 300 MB.
+ +
[STREAM_DIR =path name] +
Location of the intermediate files generated by +r.terraflow. The default location is /var/tmp.
+ +
[stats =name] +
The name of the file that contains the statistics (stats) of the +run. The default name is stats.out (in the current +directory).
+ +
+ + +

Examples

+ + + +

NOTES

+ +

One of the techniques used by r.terraflow is the +space-time trade-off. In particular, in order to avoid searches, which +are I/O-expensive, r.terraflow computes and works with an +augmented elevation raster in which each cell stores relevant +information about its 8 neighbors, in total up to 80B per cell. As a +result r.terraflow works with intermediate temporary files +that may be up to 80N bytes, where N is the number of cells (rows x +columns) in the elevation raster (more precisely, 80K bytes, where K +is the number of valid (not nodata) cells in the input elevation +raster). + +All this intermediate temporary files are stored in the path specified +by STREAM_DIR. Note: STREAM_DIR must contain enough free +disk space in order to store up to 2 x 80N bytes. + + +

The internal type used by r.terraflow to store elevations +can be defined at compile-time. By default, r.terraflow is +compiled to store elevations internally as floats. +A version which is compiled to store elevations internally as +shorts is available as r.terraflow.short. Other versions can +be created by the user if needed. + +

r.terraflow.short uses less space (up to 60B per cell, up +to 60N intermediate file) and therefore is more space and time +efficient. r.terraflow is intended for use with floating +point raster data (FCELL), and r.terraflow.short with integer +raster data (CELL) in which the maximum elevation does not exceed the +value of a short SHRT_MAX=32767 (this is not a constraint for any +terrain data of the Earth, if elevation is stored in meters). + +

Both r.terraflow and r.terraflow.short work with +input elevation rasters which can be either integer, floating point or +double (CELL, FCELL, DCELL). If the input raster contains a value that +exceeds the allowed internal range (short for +r.terraflow.short, float for r.terraflow), the +program exits with a warning message. Otherwise, if all values in the +input elevation raster are in range, they will be converted +(truncated) to the internal elevation type (short for +r.terraflow.short, float for r.terraflow). In this +case precision may be lost and artificial flat areas may be created. + +

For instance, if r.terraflow.short is used with floating +point raster data (FCELL or DCELL), the values of the elevation will +be truncated as shorts. This may create artificial flat areas, and the +outpus of r.terraflow.short may be less realistic than those +of r.terraflow on floating point raster data. + +The outputs of r.terraflow.short and r.terraflow are +identical on integer raster data (CELL). + + + +

SEE ALSO

+ + + + +

AUTHORS

+ +
+
Original version of program: The TerraFlow project, + 1999, Duke University. +
Lars Arge, + Jeff Chase, + Pat Halpin, + Laura Toma, + Dean Urban, + Jeff Vitter, + Rajiv Wickremesinghe. + +
Porting for GRASS, 2002: +
Lars Arge, + Helena Mitasova, + Laura Toma. + +
Contact: Laura Toma
+
+ + +

REFERENCES

+ +
    +
  1. + I/O-efficient algorithms for problems on grid-based + terrains. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In + Proc. Workshop on Algorithm Engineering and Experimentation, + 2000. To appear in Journal of Experimental Algorithms. + +
  2. + Flow computation on massive grids. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In + Proc. ACM Symposium on Advances in Geographic Information + Systems, 2001. + +
  3. + Flow computation on massive grid terrains. + Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma, + Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. + To appear in GeoInformatica, International Journal on + Advances of Computer Science for Geographic Information + Systems. + +
+
+

Help Index + --- grass-6.0.1.orig/debian/CVS/Root +++ grass-6.0.1/debian/CVS/Root @@ -0,0 +1 @@ +:ext:cvs.alioth.debian.org/cvsroot/pkg-grass --- grass-6.0.1.orig/debian/CVS/Repository +++ grass-6.0.1/debian/CVS/Repository @@ -0,0 +1 @@ +pkg-grass/debian --- grass-6.0.1.orig/debian/CVS/Entries +++ grass-6.0.1/debian/CVS/Entries @@ -0,0 +1,21 @@ +/NEWS/1.1/Thu Sep 8 20:26:18 2005// +/changelog/1.30/Tue Sep 13 07:46:49 2005// +/compat/1.1/Wed Nov 10 01:47:46 2004// +/control/1.22/Tue Sep 13 07:46:49 2005// +/copyright/1.3/Wed Nov 10 01:47:47 2004// +/fixpaths.sh/1.1.1.1/Tue Nov 18 15:30:47 2003// +/fixscripts.sh/1.8/Tue Sep 13 07:46:49 2005// +/grass-doc.dirs/1.3/Mon Sep 12 07:30:36 2005// +/grass-doc.install/1.4/Mon Sep 12 07:30:36 2005// +/grass-doc.links/1.3/Mon Feb 14 20:52:45 2005// +/grass.links/1.3/Mon Feb 14 20:52:45 2005// +/libgrass-dev.install/1.1/Mon Feb 14 20:57:45 2005// +/libgrass.dirs/1.1/Thu Sep 8 20:28:38 2005// +/libgrass.install/1.1/Mon Feb 14 20:57:45 2005// +/libgrass.lintian-overrides/1.1/Thu Sep 8 20:28:38 2005// +/libgrass.postinst/1.2/Sun Mar 6 00:23:21 2005// +/libgrass.postrm/1.2/Sun Mar 6 00:23:21 2005// +/manmangle.sh/1.1.1.1/Tue Nov 18 15:30:47 2003// +/rules/1.23/Mon Sep 12 15:39:39 2005// +D/patches//// +/grass.install/1.7/Tue Sep 13 08:20:03 2005// --- grass-6.0.1.orig/debian/libgrass.postrm +++ grass-6.0.1/debian/libgrass.postrm @@ -0,0 +1,42 @@ +#!/bin/sh +# Make sure grass library dir is removed from ld.so.conf +# Lifted from xfree86 package's shell-lib.sh script + +set -e + +dir="/usr/lib/grass/lib" +ldsoconf="/etc/ld.so.conf" + +if [ "$1" = "remove" ]; then + # is the line present? + if fgrep -qsx "$dir" "$ldsoconf"; then + # rewrite the file (very carefully) + set +e + fgrep -svx "$dir" "$ldsoconf" > "$ldsoconf.dpkg-tmp" + fgrep_status=$? + set -e + case $fgrep_status in + 0|1) ;; # we don't actually care if any lines matched or not + *) die "error reading \"$ldsoconf\"; fgrep exited with status" \ + "$fgrep_status" ;; + esac + set +e + cmp -s "$ldsoconf.dpkg-tmp" "$ldsoconf" + cmp_status=$? + set -e + case $cmp_status in + 0) rm "$ldsoconf.dpkg-tmp" ;; # files are identical + 1) mv "$ldsoconf.dpkg-tmp" "$ldsoconf" ;; # files differ + *) die "error comparing \"$ldsoconf.dpkg-tmp\" to \"$ldsoconf\"; cmp" \ + "exited with status $cmp_status" ;; + esac + fi +fi + +if [ "$1" = "remove" ]; then + ldconfig +fi + +#DEBHELPER# + +exit 0 --- grass-6.0.1.orig/debian/control +++ grass-6.0.1/debian/control @@ -0,0 +1,64 @@ +Source: grass +Section: science +Priority: extra +Maintainer: Debian GIS Project +Uploaders: Francesco Paolo Lovergine , Steve Halasz +Build-depends: flex, bison, libreadline5-dev | libreadline-dev, libncurses5-dev, lesstif-dev, debhelper (>= 4.0.2), dpatch, libtiff4-dev, tcl8.3-dev, tk8.3-dev, fftw-dev, libgl1-mesa-dev | libgl-dev, libglu1-mesa-dev | libglu-dev, libfreetype6-dev, autoconf2.13, autotools-dev, libgdal1-dev, proj (>= 4.4.7), libjpeg62-dev, libpng12-dev, libpq-dev | postgresql-dev, unixodbc-dev, doxygen, fakeroot, libmysqlclient14-dev +Standards-Version: 3.6.2 + +Package: grass +Section: science +Architecture: any +Depends: ${shlibs:Depends}, xterm | x-terminal-emulator, libgrass (= ${Source-Version}) +Suggests: grass-doc, gdal-bin +Description: Geographic Resources Analysis Support System + Commonly referred to as GRASS, this is a Geographic Information + System (GIS) used for geospatial data management and analysis, + image processing, graphics/map production, spatial modeling, and + visualization. GRASS is currently used in academic and commercial + settings around the world, as well as by many government agencies + and environmental consulting companies. + +Package: grass-doc +Section: science +Architecture: all +Description: Geographic Resources Analysis Support System documentation + Commonly referred to as GRASS, this is a Geographic Information + System (GIS) used for geospatial data management and analysis, + image processing, graphics/map production, spatial modeling, and + visualization. GRASS is currently used in academic and commercial + settings around the world, as well as by many government agencies + and environmental consulting companies. + . + This package contains HTML documentation for the GRASS system. + +Package: libgrass +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Description: GRASS GIS development libraries + Commonly referred to as GRASS, this is a Geographic Information + System (GIS) used for geospatial data management and analysis, + image processing, graphics/map production, spatial modeling, and + visualization. GRASS is currently used in academic and commercial + settings around the world, as well as by many government agencies + and environmental consulting companies. + . + These libraries provide the means to access and manipulate GRASS + data sets. + +Package: libgrass-dev +Section: libdevel +Architecture: any +Depends: ${shlibs:Depends}, libgrass (= ${Source-Version}) +Description: GRASS GIS library development files + Commonly referred to as GRASS, this is a Geographic Information + System (GIS) used for geospatial data management and analysis, + image processing, graphics/map production, spatial modeling, and + visualization. GRASS is currently used in academic and commercial + settings around the world, as well as by many government agencies + and environmental consulting companies. + . + This package contains the header files for developing with GRASS. + Install this package if you wish to develop software that manipulates + GRASS data sets. --- grass-6.0.1.orig/debian/NEWS +++ grass-6.0.1/debian/NEWS @@ -0,0 +1,41 @@ +grass (5.7.0+6.0.0beta2-1) unstable; urgency=high + + How to migrate to the new GRASS version + + GRASS users may ask: how to continue to work with my existing locations + in the new version... here some answers: + + Raster data + + Nothing to do. The raster commands behave (almost) the same. + + Sites data + + All sites data (related s.* commands) are now part of the vector + engine and no longer stored in an own format. + + Conversion of old sites files to new GRASS 2D/3D vector point maps: + + * v.in.sites (for single old sites map) + * v.in.sites.all (for all old sites maps in current mapset) + + Vector data + + The vector engine has been completely rewritten. All vector maps have + to be converted + + Conversion of old vector maps to new GRASS 2D/3D vector maps: + + * v.convert (for single old vector map) + * v.convert.all (for all old vector maps in current mapset) + + Note that g.list oldvect list the old vector maps which g.list vect + lists the new vector maps. + + The module v.out.ogr and v.out.ascii can be used to export from new + GRASS to old GRASS versions. + + This information is from: + http://grass.gdf-hannover.de/twiki/bin/view/GRASS/GrassSixTutorialGettingStarted + + -- Steve Halasz Fri, 4 Feb 2005 15:13:26 -0500 --- grass-6.0.1.orig/debian/rules +++ grass-6.0.1/debian/rules @@ -0,0 +1,143 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +CFLAGS=-Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +include /usr/share/dpatch/dpatch.make + +#config.status: configure +config.status: patch configure + dh_testdir + # Add here commands to configure the package. + CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr/lib \ + --sysconfdir=/etc \ + --sharedstatedir=/var \ + --enable-socket \ + --enable-shared \ + --with-postgres \ + --with-mysql \ + --with-cxx \ + --with-x \ + --with-gdal \ + --with-freetype \ + --with-motif \ + --with-readline \ + --with-nls \ + --with-odbc \ + --with-freetype-includes=/usr/include/freetype2 \ + --with-tcltk-includes=/usr/include/tcl8.3 \ + --with-postgres-includes=$(shell pg_config --includedir) \ + --with-mysql-includes=/usr/include/mysql + +build: build-stamp + +build-stamp: config.status + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + + chmod 755 debian/fixpaths.sh debian/fixscripts.sh + + touch build-stamp + +#clean: +clean: clean-patched unpatch +clean-patched: + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) distclean +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config.guess +endif + dh_clean build-stamp configure-stamp + + rm -f lib/proj/nad2bin + rm -f tools/timer/main.o + rm -f raster/r.le/r.le.setup/polytocell/*.o + rm -f raster/r.terraflow/IOStream/lib/src/libiostream.a + rm -f debian/grass60.1 + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # install grass core into debian/tmp + $(MAKE) strip + $(MAKE) install INST_DIR=$(CURDIR)/debian/tmp/usr/lib/grass \ + PREFIX=$(CURDIR)/debian/tmp/usr/lib/grass \ + BINDIR=$(CURDIR)/debian/tmp/usr/bin + + # fix all the braindead scripts + debian/fixscripts.sh + + # fix links + debian/fixpaths.sh $(CURDIR)/debian/tmp debian/tmp + + # delete extra license file + rm -f debian/tmp/usr/lib/grass/etc/license + + # change section from 1 to .1grass + mv debian/tmp/usr/lib/grass/man/man1/grass6.1 debian/grass60.1 + for m in debian/tmp/usr/lib/grass/man/man1/*.1; do n=`basename $$m .1`; mv $$m debian/tmp/usr/lib/grass/man/man1/$$n.1grass; done + for m in debian/tmp/usr/lib/grass/man/man1/*.1grass; do sed -i -e 's/^.TH \(.*\) 1/.TH \1 1grass/' $$m; done + + # move binary files out of /usr/lib + #mkdir -p debian/tmp/usr/share/grass/bwidget + #mv debian/tmp/usr/lib/grass/bwidget/images debian/tmp/usr/share/grass/bwidget/images + + # install lintian overrides + install -m 644 debian/libgrass.lintian-overrides debian/libgrass/usr/share/lintian/overrides/libgrass + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs CHANGES + dh_installdocs + dh_installexamples + dh_install --sourcedir=debian/tmp + dh_installman -pgrass debian/grass60.1 + dh_link + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- grass-6.0.1.orig/debian/changelog +++ grass-6.0.1/debian/changelog @@ -0,0 +1,249 @@ +grass (6.0.1-1ubuntu1) dapper; urgency=low + + * Rebuild to fix unmet dependencies + * debian/control: + -- changed build depend on lesstif2-deb to lesstif-dev + -- fix build depends for gl/glu transition + * debian/patches: added fix-configure.dpatch so that configure will + run + + -- Benjamin Montgomery Sun, 1 Jan 2006 13:00:33 -0600 + +grass (6.0.1-1) unstable; urgency=low + + [ Steve Halasz ] + + * New upstream release + (closes: #314059, #314063,#317470,#312583) + * Bump Standards-Version to 3.6.2 without any changes. There + are architecture independent files in /usr/lib/grass. Still + need to fix that sometime. + * C++ ABI transition. No explicit changes made. + * debian/control + - postgresql-dev -> libpq-dev + - xlibmesa-glu-dev -> libglu1-xorg-dev + - build-dep on libmysqlclient12-dev + * debian/rules + - use pg_config to locate includes + - --with-mysql + + [ Francesco Paolo Lovergine ] + + * Added versioned dependency for grass vs libgrass and grass-dev + (closes: #306497) + * Set libpq-dev | postgresql-dev build-dep to retain sarge compatibility. + Changed a bit rules file to manage pg_config by $shell feature. + (closes: #326044) + * Set libglu1-xorg-dev | xlibmesa-glu-dev build-dep to retain sarge compatibility + * Ack mysql 4.0+ support + (closes: #317497) + * Cleaned commented dhelper methods and other inappropriate + comments in rules + * libreadline-dev dependency updated + (closes: #326350) + * Changed changelog release number because of 6.0.1 release on 8/22. + * Added upstream man pages to grass-doc, in section 1grass. Removed Steve's + manual and used upstream one for grass main script. + * Added xterm-fix.dpatch to use x-terminal-emulator instead of xterm in all + scripts. Changed dependency in xterm | x-terminal-emulator as consequence + (closes: #315186) + * Fixed fixscripts.sh + * Removed a --without-cxx in rules which prevented r.terraflow build + + -- Francesco Paolo Lovergine Wed, 14 Sep 2005 16:16:57 +0200 + +grass (6.0.1-0ubunu1) breezy; urgency=low + + * New upstream release + * debian/rules: removed --with-glw, because it's not available anymore + + -- Stephan Hermann Thu, 15 Sep 2005 18:27:01 +0200 + +grass (6.0.0+6.0.1RC1-0.dgis.unstable.1) unstable; urgency=low + + * New upstream release + + -- Steve Halasz Wed, 3 Aug 2005 14:28:24 -0400 + +grass (6.0.0-1ubuntu2) breezy; urgency=low + + * rebuild because of unmet deps + + -- Stephan Hermann Wed, 14 Sep 2005 11:45:41 +0200 + +grass (6.0.0-1ubuntu1) breezy; urgency=low + + * Update {build-,}depends for xorg -> mesa transition. + + -- Adam Conrad Mon, 22 Aug 2005 16:35:32 +1000 + +grass (6.0.0-1) unstable; urgency=low + + * New upstream release + * priority optional -> extra + + -- Steve Halasz Thu, 10 Mar 2005 10:01:07 -0500 + +grass (5.7.0+6.0.0beta2-2) unstable; urgency=high + + * Apply patch from cvs to prevent accidental deletion of files + in the present working directory (Closes: #297731) + * Use fakeroot while generating html docs. + This fixes a permission problem that prevented + most docs and man pages from being created when + building with pbuilder. (Closes: #281742, #229086, #242436) + * build-depend on fakeroot + * make libgrass depend on grass + * Remove fog@debian.org from Uploaders. Thanks Federico! + * silence erroneous lintian warnings: + - postrm-unsafe-ldconfig + - maintainer-script-lacks-debhelper-token + - postinst-has-useless-call-to-ldconfig + - postrm-has-useless-call-to-ldconfig + + -- Steve Halasz Mon, 21 Feb 2005 20:49:22 -0500 + +grass (5.7.0+6.0.0beta2-1) unstable; urgency=high + + * New upstream release (Closes: #264566) + - Safe tmpdir creation (Closes: #287651) + - tcltkgrass replaced by d.m (Closes: #282567) + - r.in.gdal segfault fixed (Closes: #234275) + - r.in.bin segfault fixed (Closes: #259655) + - r.lags.1grass.gz: "name" section too long (removed) (Closes: #261726) + - raster.html: non explained commands (removed) (Closes: #287590) + - i.rectify.html: links to i.vpoints.html work (Closes: #287764) + - i.points.html: imagery.ps link fixed (Closes: #287763:) + * Help button doc path fixed (Closes: #287591) + * Change libgrass0 -> libgrass + + -- Steve Halasz Fri, 4 Feb 2005 15:13:26 -0500 + +grass (5.7.0+6.0.0beta1+cvs20050203-0.dgis.unstable.1) unstable; urgency=low + + * New upstream version from CVS + * Safe tmpdir creation (Closes: #287651) + * Build without r.terraflow until it gets tmpdir fixes + * Change libgrass5.7 -> libgrass6.0.0beta1 + * Change maintainer + pkg-grass-general -> pkg-grass-devel@lists.alioth.debian.org + + -- Steve Halasz Thu, 3 Feb 2005 09:28:43 -0500 + +grass (5.7.0+6.0.0beta1-0.dgis.unstable.2) unstable; urgency=low + + * updates to grass60 man page - grass57 -> grass60 + * link usr/lib/grass/docs/html to usr/share/doc/grass-doc/html + * patch to look for epsg codes in /usr/share/proj/epsg + * put man pages in grass-doc + * debian/control + - depend on xterm + - remove dependency on csh + + -- Steve Halasz Wed, 19 Jan 2005 09:06:51 -0500 + +grass (5.7.0+6.0.0beta1-0.dgis.unstable.1) unstable; urgency=low + + * New upstream release + + -- Steve Halasz Wed, 12 Jan 2005 16:46:24 -0500 + +grass (5.7.0-6.dgis.unstable.1) unstable; urgency=low + + * link usr/share/man/man1/grass.1.gz to usr/share/man/man1/grass57.1.gz + * debian/control + - edits to description courtesy of hmitaso@unity.ncsu.edu + - don't suggest proj. it is already required via ${shlibs:Depends} + - put grass-doc in 'science' section rather than 'Science' + + -- Steve Halasz Mon, 27 Dec 2004 18:16:41 -0500 + +grass (5.7.0-6) unstable; urgency=low + + * link /usr/bin/grass to /usr/bin/grass57 + * debian/control + - edits to description + - create grass-doc package + - don't have libgrass depend on grass + * debian/rules + - install to /usr/lib/grass instead of /usr/lib/grass57 + - run dh_shlibdeps + + -- Steve Halasz Wed, 1 Dec 2004 18:39:04 -0500 + +grass (5.7.0-5) unstable; urgency=low + + * debian/control + - change package name back to 'grass' + - convert to team maintenance with pkg-grass-general@lists.alioth.debian.org + as maintainer + - add build-deps: + + dpatch + + libjpeg62-dev + + libpng12-dev + + lesstif2-dev + - remove build-deps: + + extra second build-dep on postgresql-dev + + libgd2-xpm-dev + + postgresql-client + * debian/rules: + - clean raster/r.terraflow/IOStream/lib/src/libiostream.a + - add --with-odbc + - add --with-cxx + - add --with-glw + - add --with-motif + - remove --with-dbm and --without-dbm + - remove --with-blas and --with-lapack + + -- Steve Halasz Mon, 29 Nov 2004 18:17:46 -0500 + +grass5.7 (5.7.0-4) unstable; urgency=low + + * Add grass57 man page + * Make etc/water/seg executable + + -- Steve Halasz Tue, 12 Oct 2004 11:18:55 -0400 + +grass5.7 (5.7.0-3) unstable; urgency=low + + * Split out separate libgrass5.7 and libgrass5.7-dev packages + * Add grass libs dir to ld.so.conf. Make sure it is removed too. + + -- Steve Halasz Wed, 22 Sep 2004 00:36:12 -0400 + +grass5.7 (5.7.0-2) unstable; urgency=low + + * silence executable-not-elf-or-script lintian warning by making most tcl + scripts not executable + * silence interpreter-not-absolute lintian warning by inserting absolute path in + shebang + * make tcltkgrass/main/tksys.tcl executable + + -- Steve Halasz Fri, 3 Sep 2004 11:38:18 -0400 + +grass5.7 (5.7.0-1) unstable; urgency=low + + * install files to locations prescribed by debian policy + * fix paths hardcoded during build using script from 5.0.3 package + * change package name to enable concurrent install with stable grass package + * patch configure.in and d.text.freetype to deal with freetype.h weirdness + * build as non-native package + * clean binary files not removed by 'make clean' + + -- Steve Halasz Wed, 1 Sep 2004 10:39:27 -0400 + +grass (57-2) unstable; urgency=low + + * fixes for rules file by Giuseppe Dia + + * fixes for Debian built. Joint work with Paolo Brunetti + and Donato Minati + + -- Markus Neteler Tue, 11 Nov 2003 17:59:04 +0100 + +grass (57-1) unstable; urgency=low + + * Initial Release. Control file based on GRASS 5.0.2 deb from + Giuseppe Dia + + -- Markus Neteler Mon, 10 Nov 2003 17:59:04 +0100 --- grass-6.0.1.orig/debian/libgrass.install +++ grass-6.0.1/debian/libgrass.install @@ -0,0 +1 @@ +usr/lib/grass/lib --- grass-6.0.1.orig/debian/libgrass.postinst +++ grass-6.0.1/debian/libgrass.postinst @@ -0,0 +1,21 @@ +#!/bin/sh +# Make sure grass libraries are picked up by ldconfig +# Lifted from xfree86 package's shell-lib.sh script + +set -e + +dir="/usr/lib/grass/lib" +ldsoconf="/etc/ld.so.conf" + +# is the line not already present? +if ! fgrep -qsx "$dir" "$ldsoconf"; then + echo "$dir" >> "$ldsoconf" +fi + +if [ "$1" = "configure" ]; then + ldconfig +fi + +#DEBHELPER# + +exit 0 --- grass-6.0.1.orig/debian/grass-doc.dirs +++ grass-6.0.1/debian/grass-doc.dirs @@ -0,0 +1,2 @@ +usr/share/doc/grass-doc +usr/share/man --- grass-6.0.1.orig/debian/manmangle.sh +++ grass-6.0.1/debian/manmangle.sh @@ -0,0 +1,47 @@ +#!/bin/sh -e + +# this script mangle the manpages included in the GRASS distributions +# to produce something usable under a debian system (my only problem is +# that GRASS uses its own system [as always *grin*] to assign pages to +# sections...) + +MAN1="man1 man2 man3 man4" +MAN5="man5" +TOPDIR="`pwd`" +DESTDIR="$1" + +echo Installing manpages to $DESTDIR ... +install -d $DESTDIR +install -d $DESTDIR/man1 +install -d $DESTDIR/man5 +cd man + +# install the "section 1" manpages +echo Installing 1 manpages ... +install -m 644 utilities/man.header $DESTDIR/man1/man.header.1grass +rm -f solink +echo ".so $DESTDIR/man1/man.header.1grass" >solink +for d in $MAN1 ; do + for f in `find $d -regex "$d/[^.].+"` ; do + echo -n "Processing $f ... " + cat utilities/man.version $d/.class-header solink $f $d/.class-notice \ + >$DESTDIR/man1/`basename $f`.1grass + echo done + done +done + +# install the "section 5" manpages +echo Installing 5 manpages ... +install -m 644 utilities/man.header $DESTDIR/man5/man.header.5grass +rm -f solink +echo ".so $DESTDIR/man5/man.header.5grass" >solink +for d in $MAN5 ; do + for f in `find $d -regex "$d/[^.].+"` ; do + echo -n "Processing $f ... " + cat utilities/man.version $d/.class-header solink $f $d/.class-notice \ + >$DESTDIR/man5/`basename $f`.1grass + echo done + done +done + +rm -f solink --- grass-6.0.1.orig/debian/fixpaths.sh +++ grass-6.0.1/debian/fixpaths.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# this script try to locate all the GRASS script than got hardcoded +# the building path $HOME/... (given as an argument) and to replace it +# with the default /usr/lib/grass5 + +ZOTPATH="$1" +TMPPATH="$2" +echo Mumble mumble... trying to zot: +echo " $ZOTPATH" +echo " in $TMPPATH" + +for i in `grep -r $ZOTPATH $TMPPATH | cut -d : -f 1 | sort -u` ; do + echo -n "Grr. Zotting $i ... " + cp $i $i.old + sed -e s,$ZOTPATH,,g $i.old >$i + rm -f $i.old + echo done +done --- grass-6.0.1.orig/debian/libgrass.lintian-overrides +++ grass-6.0.1/debian/libgrass.lintian-overrides @@ -0,0 +1,4 @@ +# These are not useless calls. lintian just doesn't know that +# /usr/lib/grass/lib is in ld.so.conf +libgrass binary: postinst-has-useless-call-to-ldconfig +libgrass binary: postrm-has-useless-call-to-ldconfig --- grass-6.0.1.orig/debian/compat +++ grass-6.0.1/debian/compat @@ -0,0 +1 @@ +4 --- grass-6.0.1.orig/debian/grass-doc.links +++ grass-6.0.1/debian/grass-doc.links @@ -0,0 +1 @@ +usr/share/doc/grass-doc/html usr/lib/grass/docs/html --- grass-6.0.1.orig/debian/grass-doc.install +++ grass-6.0.1/debian/grass-doc.install @@ -0,0 +1,2 @@ +usr/lib/grass/docs/html usr/share/doc/grass-doc +usr/lib/grass/man/man1 usr/share/man --- grass-6.0.1.orig/debian/grass.install +++ grass-6.0.1/debian/grass.install @@ -0,0 +1,8 @@ +usr/bin/grass60 +usr/lib/grass/bin +usr/lib/grass/bwidget +usr/lib/grass/docs/nviz/help.tcl +usr/lib/grass/driver +usr/lib/grass/etc +usr/lib/grass/fonts +usr/lib/grass/scripts --- grass-6.0.1.orig/debian/libgrass-dev.install +++ grass-6.0.1/debian/libgrass-dev.install @@ -0,0 +1 @@ +usr/lib/grass/include --- grass-6.0.1.orig/debian/fixscripts.sh +++ grass-6.0.1/debian/fixscripts.sh @@ -0,0 +1,102 @@ +#!/bin/sh + +# this script tries to locate all the GRASS scripts than have something +# that makes lintian complain and fix them. + +CURDIR=$(pwd) + +# make these scripts executable +for x in etc/water/seg +do + chmod +x $CURDIR/debian/tmp/usr/lib/grass/$x +done + +# silence bogus lintian complaint about interpreter-not-absolute +for x in script_get_line \ + script_play \ + script_tools \ + script_file_tools \ + nviz2.2_script +do + f=$CURDIR/debian/tmp/usr/lib/grass/etc/nviz2.2/scripts/$x + sed 's.!nviz.!/usr/lib/grass/bin/nviz.' $f >foo && cat foo >$f +done + +for x in panel_label.tcl \ + panel_scale.tcl +do + f=$CURDIR/debian/tmp/usr/lib/grass/etc/nviz2.2/scripts/$x + sed 's%!../glnviz.new/nvwish%!/usr/lib/grass/etc/nviz2.2/glnviz/nvwish%' $f >foo && cat foo >$f +done +rm foo + +# silence lintian warning executable-not-elf-or-script +# add shebang to scripts that need it +for x in etc/copy +do + f=$CURDIR/debian/tmp/usr/lib/grass/$x + cp $f foo; echo "#!/bin/sh" >$f; cat foo >>$f +done +rm foo + +# silence executable-not-elf-or-script lintian warning +# most tcl scripts don't need to be executable +for x in etc/nviz2.2/scripts/panel_kanimator.tcl \ + etc/nviz2.2/scripts/panel_scale.tcl \ + etc/nviz2.2/scripts/structlib.tcl \ + etc/nviz2.2/scripts/panel_label.tcl \ + etc/nviz2.2/scripts/attPopup.tcl \ + etc/nviz2.2/scripts/attIsosurfPopup.tcl \ + etc/nviz2.2/scripts/panel_pos.tcl \ + etc/nviz2.2/scripts/panel_vol.tcl \ + etc/nviz2.2/scripts/panelIndex \ + etc/dm/labels.tcl \ + etc/dm/cmd.tcl \ + etc/dm/menu.tcl \ + etc/nviz2.2/scripts/colorPopup.tcl \ + etc/nviz2.2/scripts/multimapBrowser.tcl \ + etc/nviz2.2/scripts/panel_animation.tcl \ + etc/nviz2.2/scripts/script_support.tcl \ + etc/nviz2.2/scripts/panel_vect.tcl \ + etc/nviz2.2/scripts/panel_sdiff.tcl \ + etc/nviz2.2/scripts/assoc.tcl \ + etc/nviz2.2/scripts/unique.tcl \ + etc/nviz2.2/scripts/panel_main.tcl \ + etc/dm/grassabout.tcl \ + etc/nviz2.2/scripts/position_procs.tcl \ + etc/nviz2.2/scripts/panel_lights.tcl \ + etc/dm/d.m.tcl \ + etc/nviz2.2/scripts/panel_query.tcl \ + etc/v.digit/cats.tcl \ + etc/epsg_option.tcl \ + etc/nviz2.2/scripts/panel_query_orig.tcl \ + etc/nviz2.2/scripts/nviz_init.tcl \ + etc/dm/vector.tcl \ + etc/nviz2.2/scripts/cutplane_channels.tcl \ + etc/gis_set.tcl \ + etc/nviz2.2/scripts/panel_tst.tcl \ + etc/nviz2.2/scripts/tclIndex \ + etc/nviz2.2/scripts/send_support.tcl \ + etc/nviz2.2/scripts/panel_surf.tcl \ + etc/nviz2.2/scripts/widgets.tcl \ + etc/dm/group.tcl \ + etc/dm/tool.tcl \ + etc/nviz2.2/scripts/panel_color.tcl \ + etc/v.digit/toolbox.tcl \ + etc/nviz2.2/scripts/extra_bindings.tcl \ + etc/nviz2.2/scripts/panel_query_pg.tcl \ + etc/dm/print.tcl \ + etc/nviz2.2/scripts/panel_cutplane.tcl \ + etc/nviz2.2/scripts/panel_site.tcl \ + etc/nviz2.2/scripts/config.tcl \ + etc/nviz2.2/scripts/filemapBrowser.tcl \ + etc/dm/tree.tcl \ + etc/nviz2.2/scripts/mapBrowser.tcl \ + etc/nviz2.2/scripts/queue.tcl \ + etc/dm/raster.tcl \ + etc/v.digit/settings.tcl \ + etc/nviz2.2/scripts/wirecolorPopup.tcl \ + etc/nviz2.2/scripts/fileBrowser.tcl +do + chmod -x $CURDIR/debian/tmp/usr/lib/grass/$x +done --- grass-6.0.1.orig/debian/grass.links +++ grass-6.0.1/debian/grass.links @@ -0,0 +1,2 @@ +usr/bin/grass60 usr/bin/grass +usr/share/man/man1/grass60.1.gz usr/share/man/man1/grass.1.gz --- grass-6.0.1.orig/debian/libgrass.dirs +++ grass-6.0.1/debian/libgrass.dirs @@ -0,0 +1 @@ +usr/share/lintian/overrides --- grass-6.0.1.orig/debian/patches/CVS/Root +++ grass-6.0.1/debian/patches/CVS/Root @@ -0,0 +1 @@ +:ext:cvs.alioth.debian.org/cvsroot/pkg-grass --- grass-6.0.1.orig/debian/patches/CVS/Repository +++ grass-6.0.1/debian/patches/CVS/Repository @@ -0,0 +1 @@ +pkg-grass/debian/patches --- grass-6.0.1.orig/debian/patches/CVS/Entries +++ grass-6.0.1/debian/patches/CVS/Entries @@ -0,0 +1,5 @@ +/00list/1.10/Mon Sep 12 14:52:10 2005// +/epsg-codes-loc.dpatch/1.1/Wed Jan 19 18:04:58 2005// +/htmlgen-fakeroot.dpatch/1.1/Sun Mar 6 00:24:50 2005// +/xterm-fix.dpatch/1.1/Mon Sep 12 14:52:10 2005// +D --- grass-6.0.1.orig/debian/patches/fix-configure.dpatch +++ grass-6.0.1/debian/patches/fix-configure.dpatch @@ -0,0 +1,31 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## fix-configure.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad --exclude=CVS --exclude=.svn ./aclocal.m4 /tmp/dpep-work.kWrWOQ/grass-6.0.1/aclocal.m4 +--- ./aclocal.m4 2005-08-04 10:39:26.000000000 -0500 ++++ /tmp/dpep-work.kWrWOQ/grass-6.0.1/aclocal.m4 2006-01-01 13:20:43.000000000 -0600 +@@ -416,7 +416,7 @@ + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then +- system=MP-RAS-`awk '{print $3}' /etc/.relid'` ++ system=MP-RAS-`awk '{print $3}' /etc/.relid` + fi + if test "`uname -s`" = "AIX" ; then + system=AIX-`uname -v`.`uname -r` +diff -urNad --exclude=CVS --exclude=.svn ./configure /tmp/dpep-work.kWrWOQ/grass-6.0.1/configure +--- ./configure 2005-08-06 03:51:55.000000000 -0500 ++++ /tmp/dpep-work.kWrWOQ/grass-6.0.1/configure 2006-01-01 13:20:33.000000000 -0600 +@@ -1341,7 +1341,7 @@ + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then +- system=MP-RAS-`awk '{print }' /etc/.relid'` ++ system=MP-RAS-`awk '{print }' /etc/.relid` + fi + if test "`uname -s`" = "AIX" ; then + system=AIX-`uname -v`.`uname -r` --- grass-6.0.1.orig/debian/patches/htmlgen-fakeroot.dpatch +++ grass-6.0.1/debian/patches/htmlgen-fakeroot.dpatch @@ -0,0 +1,21 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## htmlgen-fakeroot.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: use fakeroot to avoid weird stat/permission problem when +## DP: building under pbuilder. This was preventing most man +## DP: pages from being built. + +@DPATCH@ +diff -urNad grass-5.7.0+6.0.0beta2/include/Make/Rules.make /tmp/dpep.bOaT9i/grass-5.7.0+6.0.0beta2/include/Make/Rules.make +--- grass-5.7.0+6.0.0beta2/include/Make/Rules.make 2004-12-17 05:57:28.000000000 -0500 ++++ /tmp/dpep.bOaT9i/grass-5.7.0+6.0.0beta2/include/Make/Rules.make 2005-03-01 12:48:12.000000000 -0500 +@@ -53,7 +53,7 @@ + GISBASE=$(GISBASE) \ + PATH=$(GISBASE)/bin:$$PATH \ + $(LD_LIBRARY_PATH_VAR)="$(GISBASE)/lib:$($(LD_LIBRARY_PATH_VAR))" \ +- $(1) --html-description | grep -v '' > $(PGM).tmp.html ; true ++ fakeroot $(1) --html-description | grep -v '' > $(PGM).tmp.html ; true + + # html rules for cmd commands + htmlcmd: htmlcmd1 htmlgen --- grass-6.0.1.orig/debian/patches/00list +++ grass-6.0.1/debian/patches/00list @@ -0,0 +1,4 @@ +fix-configure +epsg-codes-loc +htmlgen-fakeroot +xterm-fix --- grass-6.0.1.orig/debian/patches/epsg-codes-loc.dpatch +++ grass-6.0.1/debian/patches/epsg-codes-loc.dpatch @@ -0,0 +1,37 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## epsg-codes-loc.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad grass-5.7.0+6.0.0beta1/lib/init/epsg_option.tcl /tmp/dpep.Ly5J8O/grass-5.7.0+6.0.0beta1/lib/init/epsg_option.tcl +--- grass-5.7.0+6.0.0beta1/lib/init/epsg_option.tcl 2005-01-12 09:01:55.000000000 -0500 ++++ /tmp/dpep.Ly5J8O/grass-5.7.0+6.0.0beta1/lib/init/epsg_option.tcl 2005-01-19 11:06:33.000000000 -0500 +@@ -58,7 +58,7 @@ + global thelocation + global browsedepsg + +- set browsedepsg "/usr/local/share/proj/epsg" ++ set browsedepsg "/usr/share/proj/epsg" + set epsgLocation "newLocation" + set epsg_code "" + +@@ -91,7 +91,7 @@ + + bind .optPopup.input3_ppbEntry { + if {$browsedepsg == ""} { +- set browsedepsg "/usr/local/share/proj/epsg" ++ set browsedepsg "/usr/share/proj/epsg" + } + } + +@@ -270,7 +270,7 @@ + .infoPopup.text insert end "\nThe Grass database in which the location should be created\n\n" + .infoPopup.text insert end "\n" + .infoPopup.text insert end "\n EPSG code number of projection:\n\n" subtitle +- .infoPopup.text insert end "\nEPSG code number of projection (see /usr/local/share/proj/epsg or push the 'EPSG-codes' button)\n\n" ++ .infoPopup.text insert end "\nEPSG code number of projection (see /usr/share/proj/epsg or push the 'EPSG-codes' button)\n\n" + + pack .infoPopup.text -side left -fill both + --- grass-6.0.1.orig/debian/patches/xterm-fix.dpatch +++ grass-6.0.1/debian/patches/xterm-fix.dpatch @@ -0,0 +1,91 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## xterm-fix.dpatch by Francesco Paolo Lovergine +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad --exclude=CVS --exclude=.svn ./display/d.m/d.m.tcl /tmp/dpep-work.vpKGWW/grass-6.0.1/display/d.m/d.m.tcl +--- ./display/d.m/d.m.tcl 2005-08-01 12:16:25.000000000 +0200 ++++ /tmp/dpep-work.vpKGWW/grass-6.0.1/display/d.m/d.m.tcl 2005-09-12 16:44:23.000000000 +0200 +@@ -92,7 +92,7 @@ + ############################################################################### + proc term {cmd args} { + global env +- eval exec -- xterm -e $env(GISBASE)/etc/grass-run.sh $cmd $args & ++ eval exec -- x-terminal-emulator -e $env(GISBASE)/etc/grass-run.sh $cmd $args & + } + + +diff -urNad --exclude=CVS --exclude=.svn ./display/d.m/script/d.colors.sh /tmp/dpep-work.vpKGWW/grass-6.0.1/display/d.m/script/d.colors.sh +--- ./display/d.m/script/d.colors.sh 2005-02-28 17:33:21.000000000 +0100 ++++ /tmp/dpep-work.vpKGWW/grass-6.0.1/display/d.m/script/d.colors.sh 2005-09-12 16:45:56.000000000 +0200 +@@ -35,4 +35,4 @@ + exec g.parser "$0" "$@" + fi + +-eval `exec xterm -e d.colors map=$GIS_OPT_input` ++eval `exec x-terminal-emulator -e d.colors map=$GIS_OPT_input` +diff -urNad --exclude=CVS --exclude=.svn ./display/d.m/script/r.colors.rules /tmp/dpep-work.vpKGWW/grass-6.0.1/display/d.m/script/r.colors.rules +--- ./display/d.m/script/r.colors.rules 2005-02-28 17:34:46.000000000 +0100 ++++ /tmp/dpep-work.vpKGWW/grass-6.0.1/display/d.m/script/r.colors.rules 2005-09-12 16:46:04.000000000 +0200 +@@ -35,4 +35,4 @@ + exec g.parser "$0" "$@" + fi + +-eval `exec xterm -e r.colors map=$GIS_OPT_input color=rules` ++eval `exec x-terminal-emulator -e r.colors map=$GIS_OPT_input color=rules` +diff -urNad --exclude=CVS --exclude=.svn ./display/d.m/script/r.reclass.rules /tmp/dpep-work.vpKGWW/grass-6.0.1/display/d.m/script/r.reclass.rules +--- ./display/d.m/script/r.reclass.rules 2005-02-28 17:34:51.000000000 +0100 ++++ /tmp/dpep-work.vpKGWW/grass-6.0.1/display/d.m/script/r.reclass.rules 2005-09-12 16:45:11.000000000 +0200 +@@ -42,4 +42,4 @@ + exec g.parser "$0" "$@" + fi + +-eval `exec xterm -e r.reclass input=$GIS_OPT_input output=$GIS_OPT_output` ++eval `exec x-terminal-emulator -e r.reclass input=$GIS_OPT_input output=$GIS_OPT_output` +diff -urNad --exclude=CVS --exclude=.svn ./display/d.m/script/r.recode.rules /tmp/dpep-work.vpKGWW/grass-6.0.1/display/d.m/script/r.recode.rules +--- ./display/d.m/script/r.recode.rules 2005-02-28 17:34:57.000000000 +0100 ++++ /tmp/dpep-work.vpKGWW/grass-6.0.1/display/d.m/script/r.recode.rules 2005-09-12 16:46:16.000000000 +0200 +@@ -40,4 +40,4 @@ + exec g.parser "$0" "$@" + fi + +-eval `exec xterm -e r.recode input=$GIS_OPT_input output=$GIS_OPT_output` ++eval `exec x-terminal-emulator -e r.recode input=$GIS_OPT_input output=$GIS_OPT_output` +diff -urNad --exclude=CVS --exclude=.svn ./lib/init/epsg_option.tcl /tmp/dpep-work.vpKGWW/grass-6.0.1/lib/init/epsg_option.tcl +--- ./lib/init/epsg_option.tcl 2005-01-12 15:37:32.000000000 +0100 ++++ /tmp/dpep-work.vpKGWW/grass-6.0.1/lib/init/epsg_option.tcl 2005-09-12 16:42:11.000000000 +0200 +@@ -130,7 +130,7 @@ + if {[file exists $browsedepsg]== 1} { + if {[file exists $thelocation ]==0} { + destroy .optPopup; +- exec -- xterm -e $env(GISBASE)/etc/make_location_epsg.sh \ ++ exec -- x-terminal-emulator -e $env(GISBASE)/etc/make_location_epsg.sh \ + $epsg_code $epsgLocation $database >@stdout 2>@stderr; + DialogGen .wrnDlg "WARNING: restart Grass please" warning "WARNING: \ + Please restart Grass in order find the created location in the list (closing it for you now)" \ +diff -urNad --exclude=CVS --exclude=.svn ./scripts/r3.mapcalculator/r3.mapcalculator /tmp/dpep-work.vpKGWW/grass-6.0.1/scripts/r3.mapcalculator/r3.mapcalculator +--- ./scripts/r3.mapcalculator/r3.mapcalculator 2004-11-03 08:40:36.000000000 +0100 ++++ /tmp/dpep-work.vpKGWW/grass-6.0.1/scripts/r3.mapcalculator/r3.mapcalculator 2005-09-12 16:46:46.000000000 +0200 +@@ -130,7 +130,7 @@ + # use old style mapcalc + + if [ $GIS_FLAG_e = 1 ] ; then +- exec xterm -e r3.mapcalc & ++ exec x-terminal-emulator -e r3.mapcalc & + exit 0 + fi + +diff -urNad --exclude=CVS --exclude=.svn ./scripts/r.mapcalculator/r.mapcalculator /tmp/dpep-work.vpKGWW/grass-6.0.1/scripts/r.mapcalculator/r.mapcalculator +--- ./scripts/r.mapcalculator/r.mapcalculator 2004-11-03 08:40:36.000000000 +0100 ++++ /tmp/dpep-work.vpKGWW/grass-6.0.1/scripts/r.mapcalculator/r.mapcalculator 2005-09-12 16:46:34.000000000 +0200 +@@ -137,7 +137,7 @@ + # use old style mapcalc + + if [ $GIS_FLAG_e = 1 ] ; then +- exec xterm -e r.mapcalc & ++ exec x-terminal-emulator -e r.mapcalc & + exit 0 + fi + --- grass-6.0.1.orig/debian/copyright +++ grass-6.0.1/debian/copyright @@ -0,0 +1,44 @@ +This package was debianized by Markus Neteler on +Mon, 10 Nov 2003 17:59:04 +0100. + +It was downloaded from http://grass.itc.it + +The upstream contributors are listed in the AUTHORS file. + +The Geographic Resources Analysis and Support System (GRASS) +Geographic Information System (GIS) is Copyright by the +GRASS Development Team headquartered at ITC-irst, in Trento, Italy. + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +Parts of GRASS are not copyright by the GRASS development team. +The original authors hold the copyrights and you have to abide +to their licensing terms where noted. +(Keep in mind that code linking into GRASS can only be distributed +if compatible with the GPL.) + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License (GPL) for more details. + +On Debian systems, the complete text of the GNU General Public +License can be found in the /usr/share/common-licenses/GPL file. + +Questions regarding GRASS GIS should be directed to the +GRASS Development Team at the following address: + + GRASS Development Team + ITC-Irst + c/o M. Neteler + SSI/MPA + Via Sommarive, 18 + 38050 Trento (Povo) + Italy + neteler@itc.it + +Internet: http://grass.itc.it + http://grass.ibiblio.org --- grass-6.0.1.orig/error.log +++ grass-6.0.1/error.log @@ -0,0 +1,6 @@ +GRASS GIS compilation log +------------------------- +Started compilation: mer set 14 10:26:39 CEST 2005 +Errors in: +Finished compilation: mer set 14 10:46:53 CEST 2005 +(In case of errors please change into the directory with error and run 'make')