[GRASS-dev] ps.map layout support

Vincent Bain bain at toraval.fr
Sun Dec 18 12:30:22 EST 2011

Hello list,

here's a brief shell script I first wrote for my personal purpose. I
fear it might not be pertinent regarding recent enhancements of wx
interface (I mean the cartographic composer), but those who keep working
directly with ps.map may find it useful (add-onable ?).

Two motivations for that : i) Trimming region limits/resolution, output
scale, paper size was quite annoying (and confusing), I needed a
straight and visual way to proceed; ii) later on, in map processing, the
harcopy output was consistently treated as a poor quality 72-dpi-density
image by ImageMagick, that I frequently use to compose maps involving
transparency (guess there is a problem related to the bounding box,
since I can rasterize these outputs at better resolutions eg via Gimp.

The script needs an active monitor, and must be given page dimensions,
an output scale, and either an output density (dpi) or a region
resolution (map units). One can also point out a vector/raster
background. For example on North Carolina simple dataset, you can run :

ps.layout rast=elevation_shade w=210 h=210 scale=40000 density=300 lm=5
rm=20 tm=5 bm=50

The script lets you adjust the page position, calculates the appropriate
region, and writes a file called "settings".

The user can incorporate the result in an existing ps.map file. Myself,
I prefer concatenating it with as many instruction files I need (see
attached files). For example:

for i in {raster,vector1};do cat settings $i | ps.map --quiet out=$i.ps;
done && convert raster.ps vector1.ps -compose multiply -composite
-density 300 -colorspace CMYK geolroads.jpg && gimp geolroads.jpg

Here it is,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ps.layout.zip
Type: application/zip
Size: 3311 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20111218/5859a5fd/ps.layout.zip

More information about the grass-dev mailing list