[GRASS5] [bug #2423] (grass) ps.map raster drawing filesize

Glynn Clements glynn.clements at virgin.net
Mon May 24 00:04:13 EDT 2004


Request Tracker wrote:

> this bug's URL: http://intevation.de/rt/webrt?serial_num=2423

> Subject: ps.map raster drawing filesize

> As it is, when ps.map draws a raster map all NULL cells are drawn with
> whatever color they were given with r.colors (usually white). This is
> fine, but results in the same PostScript filesize regardless of the
> number of NULLs in the map.
> 
> I have a 1400x2000 map which is only 3% non-NULL, but the filesize is
> still 20mb; mostly FFFFFF's. Is it at least possible to replace a line
> of all NULLs with a y_position++ type PS command, even if raster data
> must be written in blocks[*]?

It would probably be easier to replace the call to "readhexstring"
with a procedure which decodes e.g. run-length encoded data (and
encode the actual image data accordingly).

Otherwise, you would need a y_position+=dy type command, which means
that you have to figure out what dy should be.

> or shrink the actual PS raster box to
> the outer bounds of the non-NULL data & reposition?

That would be feasible.

> see  grass/src/ps.map/ps.map/cmd/rast_plot.c   ps_write_mask_row()

Yep. That's the file you need to change ;)

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list