[GRASS-dev] discussion: replacing ps.map

Trevor Wiens twiens at interbaun.com
Fri Mar 30 02:13:20 EDT 2007


On Fri, 30 Mar 2007 00:03:26 +0100
Glynn Clements wrote:

> 
> Trevor Wiens wrote:
> 
> > > -- snip -- 
> > > To conduct such a test, generate a PostScript representation of a
> > > vector map using ps.map, then compare the time taken to render it to
> > > an image with "gs" against using d.vect with direct rendering.
> > > 
> > 
> > Method:
> > 1. d.vect - create and render
> > 
> > Create shell script of d.mon start, d.vect, & d.mon stop commands
> 
> Use direct rendering (GRASS_RENDER_IMMEDIATE=TRUE) and scrap the
> d.mon/d.stop phase. I'm currently more interested in rendering to
> image files than rendering directly onto the screen.

I'm not sure it really matters. If gs is creating and killing a window
and d.mon/d.stop are doing the same, the performance hit should be
similar. What we are learning is that converting rasters in ps.map is
slow. If that could be sped up there is no reason why postscript
couldn't be the primary means of displaying output in GRASS. This would
mean there would be no need of d.* commands and ps.map as separate
entities. A single interface for output could be constructed that would
produce high quality output. This new interface could be constructed in
such a way as to allow display to be controlled by either the GUI or
the command line. This would allow the elegance of having command line
control over certain aspects of the GUI. Thus bringing the two closer
together and reducing the amount of code to be written and maintained.

I listed the d.* commands as d.vect, but they were in fact d.rast and
d.vect.

> 
> > I don't know if there is a way
> > to improve on this, but perhaps it is possible to adjust the resolution
> > of the raster image within the postscript file such as the -D
> > parameter used in dvips.
> 
> The raster image will be written to the PostScript file at the current
> region's resolution. If you want a lower resolution image, reduce the
> region resolution.
> 
> If the region has a higher resolution than the display window, d.rast
> will completely skip any lines which won't be displayed. But ps.map
> can't do this, as it has no idea whether you are going to display the
> PostScript data on a 75dpi monitor or a 1200dpi laser printer.
> 

I raised this point because ps.map was much slower than d.rast but the
resolution of the output was not the same, thus the comparison wasn't
fair.

If I wanted to test the relative performance of d.rast vs ps.map how
would one determine the resolution of you x.mon?

T
-- 
Trevor Wiens 
twiens at interbaun.com

The significant problems that we face cannot be solved at the same 
level of thinking we were at when we created them. 
(Albert Einstein)




More information about the grass-dev mailing list