[GRASS-dev] [GRASS GIS] #153: ps.map: support for placement by %
for decorations
GRASS GIS
trac at osgeo.org
Wed Apr 30 05:11:19 EDT 2008
#153: ps.map: support for placement by % for decorations
-------------------------+--------------------------------------------------
Reporter: hamish | Owner: grass-dev at lists.osgeo.org
Type: enhancement | Status: new
Priority: minor | Milestone: 6.4.0
Component: default | Version: svn-develbranch6
Keywords: ps.map |
-------------------------+--------------------------------------------------
[ ported here from RT bug # 3335
http://intevation.de/rt/webrt?serial_num=3335
North arrows are now available by a number of symbols + the point command,
so someone with access could close that bug. ]
ps.map allows you to set decorations in one of three coordinate systems:
by map coordinate, by inches from the top-left of the paper, or by
percentage of map box from the bottom left corner.
map coord and percentage work from the same line, it senses if you added a
"%" to the end of the number to decide which way to use. Values outside of
0-100% are allowed so you can place decorations outside the map box. (e.g.
a caption)
The following decorations work with inches from the top-left of the page
and require recalculation every time you change the map scale.
{{{colortable, scalebar, comments, mapinfo, vlegend}}}
The problem is that the map box is not sized until after all the commands
are read in. So while % of region calculations can be done during the
parsing stage, the % of map box placement can not.
One possible solution is to add a boolean xy_is_percent int to each
decoration's control struct, then wait to call scan_percent() at the
drawing stage when the map box location is known.
I've run out of time to work on this, so I'll post the patch of how far I
got in the hope that someone else might be able to finish it.
(I got as far as discovering the map box wasn't set at parse time, and
adding the boolean flag)
The end result would be that all decorations could use % is from lower-
left of map box and a map composer GUI would be a little simpler to write.
I would not advocate removing the placement by inches support as it is
very useful in creating set page templates, where the scale, legend, and
caption all are drawn below the map box.
Hamish
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/153>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list