[GRASS-dev] [GRASS GIS] #3017: support for background option for grid labels in d.grid

GRASS GIS trac at osgeo.org
Mon May 30 12:12:48 PDT 2016

#3017: support for background option for grid labels in d.grid
  Reporter:  veroandreo   |      Owner:  grass-dev@…
      Type:  enhancement  |     Status:  new
  Priority:  normal       |  Milestone:  7.3.0
 Component:  Display      |    Version:  unspecified
Resolution:               |   Keywords:  d.grid, gsoc2016, cartography
       CPU:  Unspecified  |   Platform:  Unspecified

Comment (by lazaa):

 Replying to [comment:4 annakrat]:
 > Replying to [comment:3 lazaa]:
 > > Replying to [comment:2 annakrat]:
 > > > Thanks for the patch, but I am getting weird results (see
 attachment). It's possible I might have done something wrong when applying
 the patch, because I needed to get rid of the whitespace changes. Could
 you please check this?
 > > >
 > > > Also `bg_color` should be probably changed to `bgcolor` to be
 compatible with all other modules having this option.
 > > >
 > > > Ideally please upload a new patch without the whitespace changes.
 > >
 > > OK, I will change it to {{{bgcolor}}}. I think the problem is not in
 whitespaces. The size of label background depends on the font size. I
 tested it on several font sizes and I got good results but obviously it
 doesn't work in general.
 > It seems to change with zoom level, so I think you have to somehow
 convert between the pixel and geographic coordinates.

 I uploaded new patch with original whitespaces/tabs.

 I looked how it is done in d.text module. Now is the margin of the text
 box calculated from width and height of the text inside text box.

 Another problem is that if user uses flag -g or -w. The geographical grid
 isn't horizontal/vertical so the labels are a bit rotated. But I couldn't
 find any way how to rotate the text box for filling background. I attached
 an image.

Ticket URL: <https://trac.osgeo.org/grass/ticket/3017#comment:5>
GRASS GIS <https://grass.osgeo.org>

More information about the grass-dev mailing list