[GRASSLIST:765] p.map.new & rast2gif (in GRASSLinks)

Hayashi Shin-ichiro forest at bres.tsukuba.ac.jp
Mon Jul 21 09:31:19 EDT 2003


Dear GRASS Users:

I'trying to install GRASSLinks.

GRASSLinks has "rast2gif" command to convert map file to gif file.
 
rast2gif-----------------------------------------------------

#! /bin/sh
trap "/bin/rm -f $TMP_PATH/grasslinks.$$.ppm"  0 1 2 3 5 9 15

GIF=$1
GRASTER=$2
GVECTOR=$3
GSITES=$4
VCOLOR=$5
SCOLOR=$6
GIF_SIZE=$7
SCRIPT=$TMP_PATH/pmap_script.$$

touch $SCRIPT
p.select ppm > /dev/null 2>&1

if [ $GRASTER != "none" ]
then
        echo "raster $GRASTER" >> $SCRIPT
fi

if [ $GVECTOR != "none" ]
then
        echo "vector $GVECTOR" >> $SCRIPT
        echo "     color $VCOLOR" >> $SCRIPT
        echo "     end" >> $SCRIPT
fi

if [ $GSITES != "none" ]
then
        echo "sites $GSITES" >> $SCRIPT
        echo "     color $SCOLOR" >> $SCRIPT
        echo "     end" >> $SCRIPT
fi

echo "end" >> $SCRIPT

p.map.new input=$SCRIPT  > /dev/null 2>&1

case $GIF_SIZE in
    large)   MAX_RES=800 ;;
    medium) MAX_RES=400 ;;
    small) MAX_RES=200 ;;
esac

( $PBM_PATH/pnmscale -xysize $MAX_RES $MAX_RES < $MAPLP | $PBM_PATH/ppmquant 256
| $PBM_PATH/ppmtogif > $TMP_PATH/$GIF ) 2> /dev/null

-------------------------------------------------------------------

The first half of this script works,(to echo "end" >> $SCRIPT )
Because this script makes "$SCRIPT" file. 
But "p.map.new" command can't make ppm file.
Why can't "p.map.new" command make ppm file?

Please give me your suggestion.

And I have some questions.
1) "p.map.new" command demands parameter "GISBASE" and "GISRC".
    How does GRASSLinks read these parameter?
 
2) In this script, Which does p.map.new use ppm driver?

Glynn Clements wrote:
>I think that the PPM driver is disabled by default. Try copying the
>file etc/paint/driver.uninst/ppm to etc/paint/driver.sh/ppm.
 
GRASS has already have PPM driver in /*/grass/etc/paint/driver.sh/ppm .
On the other hand, GRASSLinks has PPM driver in /home/grass/grasslinks/paint/dreiver.sh/ppm .
Which does p.map.new use ppm driver?

Please give me your advise.
Thank you in advance.
Sincerely yours.





More information about the grass-user mailing list