[GRASS-user] d.slide.show

Ivan Shmakov oneingray at gmail.com
Mon Jul 16 23:53:57 EDT 2007


>>>>> goldneaa at onid orst edu <goldneaa at onid.orst.edu> writes:

 > I have a quick question about the usage of d.slide.show.  Right now I
 > am able to create a slide show for my raster files.  Two problems I
 > am having so far is that my rasters are out of order.  I know that
 > when I bring them in they are bringing them in in alphabetical order.
 > Example.  raster.1,raster.10,raster100,raster1000,raster.1001.  But
 > this is not the way I want them presented in my show.  I need the
 > raters just to move from 1-1560.  Is there a tool that will order my
 > rasters in this format for presentation in the show.

        One solution would be to rename the rasters from raster.1
        .. raster.1000 ... to raster.00001 .. raster.01000 ...,
        e. g. (in Sh):

GRASS> g.mlist type=rast pattern=raster.\* \
           | sed -e 's/\([0-9]\+\)$/ \1/' \
           | (while read pfx num ; do \
                  padded="$(printf %5d "$num")" \
                  g.rename rast="${pfx}${num}","${pfx}${padded}" \
              done)

        (The script is probably worth wrapping in a Sh script file.)

[...]




More information about the grass-user mailing list