[GRASS-dev] limits of r.patch
Markus Neteler
neteler at osgeo.org
Sun Jul 15 13:11:06 PDT 2012
On Fri, Jul 13, 2012 at 5:27 PM, Margherita Di Leo
<dileomargherita at gmail.com> wrote:
> Hi All,
>
> I probably am requiring too much, but this is just for sharing an
> experience. I've just imported in GRASS 1573 ASTER GDEM tiles, using
> r.external, and everything seemed to be OK. Then I ran:
>
> GRASS 6.4.3svn (ASTER_GDEM):~ > r.patch in=`g.mlist pat=AST* sep=,`
> out=aster_gdem
> ERROR 1: TIFFOpen:/forest/ASTER-GDEM/Dem_lzw/ASTGTM_N45E010_dem_lzw.tif: Too
> many open files
> WARNING: Unable to open raster map <ASTGTM_N45E011_dem_lzw.tif at PERMANENT>
> ERROR: One or more input raster maps not found
>
> I'm on Red Hat Enterprise Linux Server Rel. 6.3, RAM 16 GB.
Linux (and other OSes, likewise) has a limit of opening 1024 files
in parallel.
However, you can enlarge this, see:
http://grass.osgeo.org/gdp/html_grass64/r.series.html
--> "Number of raster maps to be processed is given by the limit of
the operating system."
I used happily 1500 files in the past.
Alternative:
Make the mosaik with gdalwarp and import/register this single file.
Here a simple script, using the GDAL cache to speed up (you'll
need to adapt it):
RES=10.0
BIGTIFF="-co BIGTIFF=YES"
# GDAL cache in megabytes
CACHE="--config GDAL_CACHEMAX 8000 -wm 8000"
LIST="`ls aster*.tif`"
gdalwarp $CACHE $BIGTIFF -srcnodata 65535 -dstnodata 65535 -r bilinear
-tr $RES $RES $LIST mosaik_$RES.tif
gdaladdo mosaik_$RES.tif 2 4 8 16 32
Hope this helps,
Markus
More information about the grass-dev
mailing list