[GRASS5] error encountered in r.terraflow

Shaun Walbridge walbridge at nceas.ucsb.edu
Thu Apr 27 16:38:04 EDT 2006


My response to the same question, on GRASSLIST:

This error occurs because currently Terraflow uses the standard C file 
stream calls. The permanent solution to this would be to add some 
Makefile magic to detect the current platform, and use the appropriate 
stream types.  The temporary solution is to use the patch I've attached. 
You'll need the grass source tree, to apply the patch do something like:

cd /grass6/raster/r.terraflow/IOStream/include
patch < ami_stream.h.patch
cd ../..
make clean
make

Then install this modified terraflow.

Do any GRASS devs have the time and expertise to make terraflow 
largefile aware? In my experience this (very minor) patch does the 
trick, should be just fseek / ftell which need proper detection

Cheers,
Shaun Walbridge

abhay menon wrote:

> Hello list,
>  
> after the prior process of getting 2gb data conversion using gdal with 
> grass61cvs been a success.
>  
> i am facing a problem with terraflow process on the 2gb dataset(ESRI 
> Ascii Raster Grid) which i converted to grass raster grid file.
>  
> r.terraflow December 2003
> region size is 19954 x 21199
> cell newdata header compatible with region header
> elevation stored as FLOAT (4B) WARNING: raster newdata is of type 
> CELL_TYPE --you should use r.terraflow.short
>
> STREAM temporary files in /var/tmp  (THESE INTERMEDIATE STREAMS WILL 
> NOT BE DELETED IN CASE OF ABNORMAL TERMINATION OF THE PROGRAM. TO SAVE 
> SPACE PLEASE DELETE THESE FILES MANUALLY!)
> SFD (D8) flow direction
> D8CUT=999999986991104.000000
> memory size: 1000.00M (1048576000) bytes
> Memory manager registering memory in MM_WARN_ON_MEMORY_EXCEEDED mode.
> reading data from newdata to stream /var/tmp/STREAM_NnrFqS:
>
> total elements=423004846, nodata elements=153409740
> largest temporary files:
>    FILL: 22.06G (23688271376) [423004846 elements, 56B each]
>    FLOW: 20.09G (21567608480) [269595106 elements, 80B each]
> Will need at least 44.12G (47376542752) space available in /var/tmp
> ------------------------------
> COMPUTING FLOW DIRECTIONS
> classifying nodata (inner & boundary)
> finding nodata
> relabeling nodata
> MM warning: limit=1048576000B. allocating 524140056B.  limit exceeded 
> by 58762B.
> :
> :
> merging relabeled grid
> MM warning: limit=1048576000B. allocating 524140056B.  limit exceeded 
> by 58762B.
> :
> :
> ----------
> assigning preliminary directions
> ----------
> finding flat areas (plateaus and depressions)
> plateau.cc:starting memscan
> plateau.cc:memscan done
> removing duplicate plateaus
> MM warning: limit=1048576000B. allocating 524140060B.  limit exceeded 
> by 58770B.
> :
> relabeling plateaus
> MM warning: limit=1048576000B. allocating 524140060B.  limit exceeded 
> by 58766B.
> generating plateau statistics
> MM warning: limit=1048576000B. allocating 523975900B.  limit exceeded 
> by 58766B.
> ----------
> assigning directions on plateaus
> MM warning: limit=1048576000B. allocating 524222112B.  limit exceeded 
> by 48098B.
> --------------
> generating watersheds and watershed graph
> creating windows
> warning: using slower scan
> r.terraflow: 3scan.h:163: void scan3line(FUN&, AMI_STREAM<T>*, 
> AMI_STREAM<T>*, AMI_STREAM<T>*, BASETYPE, dimension_type) [with T = 
> waterGridType, BASETYPE = waterWindowBaseType, FUN = waterWindower]: 
> Assertion `ae == AMI_ERROR_END_OF_STREAM' failed.
>
>
> and also seem not to process data above 1gb(ESRI Ascii Raster Grid) too.
> is there anything else i missed while compilation of grass?
>  
> PS. i had this was my configuration, compilation and installation 
> statement from grass61cvs.
>  
> ./configure --enable-shared --with-fftw --with-includes=/usr/include 
> --with-libs=/usr/lib --with-motif --with-freetype=yes 
> --with-freetype-includes=/usr/include/freetype2 --with-nls 
> --with-gdal=/usr/local/bin/gdal-config --with-proj 
> --with-proj-includes=/usr/include --with-proj-libs=/usr/lib --with-glw 
> --with-cxx --with-mysql --with-mysql-includes=/usr/include/mysql 
> --with-mysql-libs=/usr/lib/mysql --with-postgres 
> --with-postgres-includes=/usr/include/pgsql 
> --with-postgres-libs=/usr/lib --with-odbc=yes 
> --with-odbc-includes=/usr/include --with-odbc-libs=/usr/lib 
> --with-glw=yes --enable-largefile;
> make;
> make install
>  
> -- 
> Best Regrads
>
> Abhay Menon




More information about the grass-dev mailing list