[GRASS-user] raster from a mapset to other

Philipp Steigenberger userlist at online.de
Mon Jan 28 07:35:26 EST 2008


Alfredo Alessandrini schrieb:
> how can import a raster from a mapset to other?
>
>
> Alfredo
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>   
 From current mapset  just use
g.copy [rast=from at source_mapset,to]

i.e.
g.copy rast=map1 at mapset1,map1


If you want to copie more than one maps you could use this script I wrote:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#!/bin/sh

## copies all rastermaps (map)
## r.copy map(1) map(2) map(n)
## from desired mapset to the current mapset



echo "Source-mapset?"
read  answer1
echo "Would you like to add a suffix to the map-names?"
echo "(i.e. '_a' results in map_a)"
read answer2
echo "Would you like a prefix to the map-names?"
echo "(i.e. 'b_' results in b_map)"
read answer3

filelist=$*



      for f in $filelist ; do


          echo copies ${f}\@${answer1} to ${answer3}$f${answer2}
      echo
          g.copy rast=${f}\@${answer1},${answer3}$f${answer2}

###################################################################
####### for copying vektorfiles change the scirpt in ##############
######### g.copy vect=${f}\@${answer1},${answer3}$f${answer2}######
###################################################################

      done

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
You can list the desired mapset with i.e.

g.list rast mapset=PERMANENT

cheers
Philipp


-------------- nächster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20080128/deb11e47/attachment.html


More information about the grass-user mailing list