ps.map: support for placement by % for decorations
|Reported by:||hamish||Owned by:||hamish|
|Keywords:||ps.map||Cc:||grass-dev@…, annakrat, martinl|
[ 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.
Change History (7)
comment:2 by , 13 years ago
|CPU:||Unspecified → All|
|Milestone:||6.4.0 → 6.5.0|
|Platform:||Unspecified → All|
follow-up: 5 comment:3 by , 12 years ago
|Priority:||minor → major|
|Status:||new → assigned|