[GRASS5] [bug #3705] (grass) ps.map resolution

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

Subject: ps.map resolution

Platform: Mac OSX
grass obtained from: Other (CDROM etc)
grass binary for platform: Downloaded precompiled Binaries
GRASS Version: 6.1cvs 20050917

Hi all, there is a limit to the resolution with which a postscript can be rendered. It is limited to 75
dpi. However many rasters are much finer resolution than this. It would be nice to be able to set the
postscript to any scale we'd like, and have it print at the resolution of the region. Below is from the
mailing list archive GRASSLIST 8404

Cheers,
Ian

Sorry, you're right; ps.map has a hardcoded limit of 75dpi. The
"scale" command changes the size of the image, and thus of the
computed resolution.

set_paper.c has a hardcoded setting:

    PS.res = 75;

This is used in map_setup.c to limit the size of a raster:

  if (PS.grey || PS.level == 1) limit = 300000000L;
  else limit = 100000000L;
      while (num_cells > limit || cells_per_inch > PS.res)
      {
      if (PS.cells_high >= PS.cells_wide)
            {
        PS.cells_high /= 2;
        PS.ns_res *= 2.0;
        PS.row_delta++;
    cells_per_inch /= 2;
      }
      else
      {
        PS.cells_wide /= 2;
        PS.ew_res *= 2.0;
        PS.col_delta++;
    cells_per_inch /= 2;
      }
          num_cells = (long)PS.cells_high * (long)PS.cells_wide;
      }

Thus it effectively rescales the raster by powers of two until it is
less than 75dpi and contains less than 3E8 pixels for greyscale or 1E8
pixels for colour.

You may be able to get around the 75dpi limit by selecting a larger
paper size then rescaling it with psresize (from the psutils package).

Personally, I think that code should simply be removed. I suspect that
it was put there to prevent users from accidentally creating huge
print jobs on a system which couldn't handle them.

Note that the image is "streamed" (rendered as it is read from the
PostScript file, not stored), so the amount of memory in the printer
isn't an issue.

So it seems to me that the resolution is based on the region, and the
output device that the postscript is written to. The effective
resolution of the raster in the postscript file does not necessarily
equal that of the region. My question is this, how does one get an
effective resolution equal to that of my region in my final postscript
file using ps.map? Can I set up a fake output device with a really
high resolution in Grass 6?

Use a larger paper size, or simply remove all references to PS.res
from ps.map.

Glynn Clements <glynn@gclements.plus.com>

-------------------------------------------- Managed by Request Tracker