bugs in v.report?
Xin Zhuang
zhuang at access.digex.net
Fri Jan 27 11:51:13 EST 1995
Here is the patch:
*** do_v_stats.c Fri Jan 27 11:47:34 1995
--- do_v_stats.c.new Fri Jan 27 06:35:56 1995
***************
*** 35,41 ****
{
int nArea, nLine, map_type, v_r;
! int cnt=0, cat_no, line, linea, island;
int first, tot_cats, n_points, cmp();
register int area_num, line_num, i, ii, jj, kk;
char *calloc(), *label_name, null[1];
--- 35,42 ----
{
int nArea, nLine, map_type, v_r;
! int cnt=0, line, linea, island;
! CELL cat_no;
int first, tot_cats, n_points, cmp();
register int area_num, line_num, i, ii, jj, kk;
char *calloc(), *label_name, null[1];
***************
*** 119,134 ****
/* get the category number for area "area_num" */
cat_no = Map.Att[Map.Area[area_num].att].cat;
/*fprintf(stderr,"\ncat#= %d\n",cat_no);*/
! label_name = G_get_cat(cat_no, cats);
/* Calculate polygon area */
V2_get_area(&Map,area_num,&Areas);
! Vect_get_area_points(Map, area_num, Points);
f_area = G_area_of_polygon(Points->x,
Points->y, Points->n_points);
/* dig_find_area2(&Map,Areas,&f_area);*/
- tot_area = f_area;
/* if this area contains islands remove the
island areas */
--- 120,134 ----
/* get the category number for area "area_num" */
cat_no = Map.Att[Map.Area[area_num].att].cat;
/*fprintf(stderr,"\ncat#= %d\n",cat_no);*/
! label_name = G_get_cat(cat_no, &cats);
/* Calculate polygon area */
V2_get_area(&Map,area_num,&Areas);
! Vect_get_area_points(&Map, area_num, Points);
f_area = G_area_of_polygon(Points->x,
Points->y, Points->n_points);
/* dig_find_area2(&Map,Areas,&f_area);*/
/* if this area contains islands remove the
island areas */
***************
*** 142,152 ****
if (f_area > 0) tot_area = tot_area - f_area;
else tot_area = tot_area + f_area;
*/
! Vect_get_isle_points(Map, Map.Area[area_num].isles[ii], Points);
f_area = f_area - G_area_of_polygon(Points->x,
Points->y, Points->n_points);
}
}
if (first)
{
--- 142,153 ----
if (f_area > 0) tot_area = tot_area - f_area;
else tot_area = tot_area + f_area;
*/
! Vect_get_isle_points(&Map, Map.Area[area_num].isles[ii], Points);
f_area = f_area - G_area_of_polygon(Points->x,
Points->y, Points->n_points);
}
}
+ tot_area = f_area;
if (first)
{
More information about the grass-user
mailing list