[GRASS5] [bug #825] (grass) r.poly doesn't write label points correctly

Glynn Clements glynn.clements at virgin.net
Sat Nov 10 09:53:50 EST 2001


Request Tracker wrote:

> When converting the dig_att/testpat to a sites list, the 
> label positions are quite strange.
> I would expect the centers of the pattern.

It uses the horizontal midpoint of the widest part of the polygon:

  write_att(lab_digit, (char) dig_new_to_old_type(type),
      cell_head.west + (p->col + (p->width / 2.0)) * cell_head.ew_res,
      cell_head.north - (p->row + 0.5) * cell_head.ns_res,
      cat);

At first glance, the obvious change would seem to be to change:

      cell_head.north - (p->row + 0.5) * cell_head.ns_res,
to:
      cell_head.north - (p->row + (p->height / 2.0)) * cell_head.ns_res,

However, "struct area_table" doesn't have a height field. That would
need to be added (to extr_areas.h), and bounds.c would need to be
updated to record the height as well as the width.

"cvs log" suggests that all of the recent non-trivial changes have
been done by Andrea Aime, so he would be the obvious "volunteer" ;)

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list