[GRASS-user] r.region
Maciej Sieczka
tutey at o2.pl
Tue Jul 3 18:24:31 EDT 2007
goldneaa at onid.orst.edu wrote:
> If I have about 800 raster files in tiff format that are in the wrong
> projection. Is there a way to change their coordinate systems all at
> once. After examining r.region it seems to only want to change one
> raster at a time. Will I have to build a command in unix, in order to
> change these rasters projections?
r.region is not for changing raster's projection. It only moves and
rescales it in space, by setting "the boundary definitions for a raster
map".
If you want to reproject, use r.proj instead.
As to multiple raster input - in shell you could use something like:
for i in `g.list rast mapset=some_mapset | grep
string_common_for_all_rasters_you_want_included`
do
r.some.command input=${i} output=${i}_suffix
done
Mind that g.list always prints a few extra lines of text at the top and
the bottom of it's output, which you have to watch out for when
grep'ping for a string. You can filter them out with:
g.list rast mapset=some_mapset | grep -v "files available in
mapset\|----------------------------------------------"
BTW - it would be really nice IMHO to have a "Print in shell script
style" option in g.list, ie. no extra text, one name per line.
Maciek
More information about the grass-user
mailing list