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

Xueming Wu xwu at cse.unl.edu
Mon Jul 21 10:41:41 EDT 2003


Hi,

If your GRASSLINKS can create pmap_script.$$ but can't create gif,
you need to check the followings are correct:

1. if p.map.new generates ppm file. p.map.new will create a
file named paint.ppm. And the direcotry of paint.ppm is defined
in grass5/etc/paint/driver.sh/ppm by MAPLP.

2. if ppmtogif works. ppmtogif is a tool of unix/lunix. It read
the paiint.ppm and convert it into gif. So, please make sure
setup for directory is correct.

The setup for GISBASE and GISDBASE  is done in one of GRASSLINKS
funtion.

Regards,

Xueming

On Mon, 21 Jul 2003, Hayashi Shin-ichiro wrote:

> 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