[GRASS-user] d.slide.show

Hamish hamish_nospam at yahoo.com
Tue Jul 17 03:44:24 EDT 2007


goldneaa wrote:
> 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.

try this patch:

  sort -n -k2 -t.
(sorts numerically instead of alphabetically, sorts on the second field
[delimited by a "."])


Index: d.slide.show
===================================================================
RCS file:
/home/grass/grassrepository/grass6/scripts/d.slide.show/d.slide.show,v
retrieving revision 1.13
diff -u -r1.13 d.slide.show
--- d.slide.show        17 Jun 2007 10:18:08 -0000      1.13
+++ d.slide.show        17 Jul 2007 05:42:49 -0000
@@ -175,7 +175,8 @@
        then
                continue
        fi
-       for i in MASK `ls cell/$PREFIX* 2> /dev/null`
+#      for i in MASK `ls cell/$PREFIX* 2> /dev/null`
+       for i in MASK `ls cell/$PREFIX* | sort -n -k2 -t.`
        do
                i=`echo $i | sed 's/cell\///'`
                if [ ! $i = "MASK" ]


but maybe that hits the max command line buffer of 4096 chars recently
seen in the csh thread??


The typical solution to this problem is to name the files (maps) as
raster.0001, raster.0002, ..., raster.1560.

e.g., to rename maps using awk + printf("%04d"):

#!/bin/sh
for MAP in `g.mlist pattern="raster.*"` ; do
  NEW_NAME=`echo "$MAP" | awk -F. '{printf("%s.%04d", $1, $2)}'`
  #echo "[$MAP] -> [$NEW_NAME]"
  g.rename "$MAP,$NEW_NAME"
done


> Second, between my raster files a white screen pops up and has
> lettering from the file extension of my raster files.  Is there a way
> for the slideshow to simply just run through the rasters without
> this interuption.

? No idea. What's the command line you are using? across=1 and down=1?
It writes "$MAPNAME in $MAPSET" text in a caption at the bottom..?


You might also try xganim for the slideshow. (didn't Glynn write a
tcl replacement for this a while back?)

Also r.out.mpeg is there and http://grass.gdf-hannover.de/wiki/Movies


Hamish




More information about the grass-user mailing list