Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to read in multiple (hundreds, thousand) LiDAR ascii files into Grass. They contain elevation data. I think I have managed one, and I can make a map of elevations, using File, Import Raster Map, Multiple formats using GDAL. The format is as follows:

ncols         1000
nrows         1000
xllcorner     562000.000
yllcorner     7124000.000
cellsize      1
nodata_value  -9999.0
108.93 108.92 108.97 108.99 109 109.01...

1000 lines, 1000 columns, representing 1 sq km with values at every 1 m. Files are called



My question is, how do Y read in multiple files? I have tried concatenating them, no luck.

Thank you for your help.. regards, Szilard

share|improve this question

You can simply import them in a loop like this:

for myfile in `ls 5*-7*_dem_1m.asc` ; do
  # remove .asc extension
  outname=`basename $myfile .asc`
  # import current file input=$myfile output=$outname
# mosaik the tiles
r.patch input=`g.mlist rast pattern="5*-7*_dem_1m" sep=","` output=dem_1m
# colorize the result
r.colors dem_1m color=elevation

Note: if you had a more recent GRASS GIS version, use r.external instead of to just register the files rather than physically importing them.

Eventually, remove the individual imported files with g.mremove and the above mentioned pattern. Done.

For a user interface solution (select by click), see Importing multiple raster (e.g., GeoTIFF) files

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.