[GRASS-dev] Re: [GRASS GIS] #64: ps.map: patch to set customized scalebar units

GRASS GIS trac at osgeo.org
Mon Sep 15 04:41:31 EDT 2008


#64: ps.map: patch to set customized scalebar units
--------------------------+-------------------------------------------------
  Reporter:  alf          |       Owner:  hamish   
      Type:  enhancement  |      Status:  closed   
  Priority:  minor        |   Milestone:  6.4.0    
 Component:  ps.map       |     Version:  svn-trunk
Resolution:  fixed        |    Keywords:  scalebar 
  Platform:  All          |         Cpu:  All      
--------------------------+-------------------------------------------------
Comment (by hamish):

 [comment:9 hamish]:
 > > I don't know if it is possible to get the right-hand coordinate of a
 PS pseudo-text box when the text is left-justified. I do not wish to
 right-justify those labels.

 Replying to [comment:10 glynn]:
 > You can use the `stringwidth` operator to obtain the width of a string
 (the distance that the current point will move if you `show` the string).
 If the string is short, you can obtain the bounding box with a combination
 of the `charpath` and `pathbbox` operators (if the string is long,
 `charpath` may overflow the maximum path length).


 ok, thanks. I made a note of that in the source. For now I've worked out a
 better placement algorithm and it seems to work ok.

 I also added a few different placement options (above, to the right,
 below, ..) but for now control of that is only by modifying the source
 code directly.


 Hamish

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/64#comment:11>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list