SUMMARY - ppm output
Mark Gregory
mg at soil.agr.okstate.edu
Fri Aug 16 09:34:10 EDT 1996
My original question is as follows:
>
> Help, I cannot seem to figure out how GRASS decides how large to make the
> output ppm file when using p.map with the ppm driver selected within p.select.
>
> At this point I am only using a raster file with 186 rows and 363 columns of
> data. The scale value within the p.map commands does not seem to affect the
> size of the output ppm file. Changing the region prior to running p.map does
> affect the size of the output ppm file, but not in a logically (at least to
> me) manner.
>
> For example, when I use the entire raster file as input (186 rows, 363 cols.),
> the size of the output ppm file is approx. 986k. Next, when I use the same
> data set (and cell size) but set the region to the first 93 rows and all 363
> cols, the size of the output ppm file is 511k. That makes sense. HOWEVER,
> when I use the same data set and cell size but set the region to the first 93
> rows but only the first 180 columns of data, the output ppm file INCREASES to
> 1889k. It this last case, the input data file was approximately 1/4 the size
> (in terms of rows and columns of data), but the output ppm file was about
> twice in size. It does not make sense to me.
>
> In addition to adjusting the region and the p.map scale parameters, I have
> also changed the GRASS_HEIGHT, GRASS_WIDTH, XDRIVER GRASS_HEIGHT and XDRIVER
> GRASS_WIDTH environmental variables without being able to affect the size of
> the output ppm file.
>
The answer to the varying sized output files from p.ppm apparently lies with
the fact that p.ppm 'scales' the output data until the largest dimension
(height/rows or width/columns) is constrained by the 800 bits of output data
(much like p.map does to the existing size of the GRASS Graphics Monitor when
preview is selected in p.select prior to running p.map).
As to changing the maximum dimension of output from the default size of 800;
I only received one response from jeg at cats.uscs.edu - but it accomplished
exactly what I was attempting to do.
Thanks!!
The response and procedure for changing the output size of p.ppm from its
default size of 800 x 800 is as follows:
>
> you have to make a minor change to
> one of the shell scripts if you want anything other than 800x800.
>
> it uses two enviroment variables, WIDTH and HEIGHT, but it
> sets them to 800, instead of checking to see if you have
> already set them. the following change makes it only set
> WIDTH and HEIGHT if you have not already set them.
>
> first you have to find the shell script file to change.
> start up grass and
> cd $GISBASE/etc/paint/driver.sh
> the file called ppm in the following dir needs the following patch
>
> *** /a/darwin/export/src/jeg/grass4.1.5_fp/axp/etc/paint/driver.sh/ppm.orig T
> ue Dec 19 22:02:51 1995
> --- ppm Mon May 6 15:42:26 1996
> ***************
> *** 13,20 ****
> NBLOCKS=1
>
> MAPLP=${MAPLP-$HOME/paint.ppm}
> ! WIDTH=800
> ! HEIGHT=800
> cp /dev/null $MAPLP
> export HRES VRES NCHARS MAPLP WIDTH HEIGHT
> export TEXTSCALE TEXTSPACE TEXTFUDGE BLOCKSIZE BLOCKSPACE NBLOCKS
> --- 13,19 ----
> NBLOCKS=1
>
> MAPLP=${MAPLP-$HOME/paint.ppm}
> ! : ${WIDTH:=800} ${HEIGHT:=800}
> cp /dev/null $MAPLP
> export HRES VRES NCHARS MAPLP WIDTH HEIGHT
> export TEXTSCALE TEXTSPACE TEXTFUDGE BLOCKSIZE BLOCKSPACE NBLOCKS
>
>
>
> then before you do p.select do
> setenv WIDTH 666
> setenv HEIGHT 800
> or whatever you want.
>
>
>
> note our grass version is grass4.1.5_fp but yours will probably be a different
> different version. this trick should still work, it just means that
> the directory name below is wrong. our machine architecture is axp,
> but yours would probably be something different like "sun"
>
Mark
Mark Gregory mg at soil.agr.okstate.edu
Oklahoma State University 405-744-9603
Stillwater, OK 74078-6028 405-744-5269(fax)
More information about the grass-user
mailing list