bug and fix for v.db.rim in GRASS4.0

GEOL1 at CWU.BITNET GEOL1 at CWU.BITNET
Wed Oct 7 19:57:00 EDT 1992


Subject: bug and fix for v.db.rim in GRASS4.0

Two users have reported problems in the vector maps created by v.db.rim
after a query for a subset of lines.  The general conditions which lead
to the error are labelled areas (polygons) bounded by lines which are
also labelled in the vicinity of other labelled lines.  If a map with
these conditions is read into a v.db.rim data base, a query made,
and then a new vector file written, the problem may occur and expresses
itself as some of the lines in the vicinity being selected instead of
some of the polygon boundary lines.  The bug is likely data dependent.
Fix by following instructions in [ ].

*********************************************************
[cd to .../src.garden/grass.rim/v.db.rim ]
[Edit cmd/vect_map.c begining at line 233 ]
      case LINE_CHAR:
        /* get the line and add it to the binary vector file */
        cur_line = dig_point_to_line(&(Curr_map.info), s1->east,
                                     s1->north, LINE|AREA); [mod this line]
        cur_type = LINE;                                    [delete this line]
        cur_type = Curr_map.info.Line[cur_line].type;       [add this line]
/*fprintf(stdout,"Returned line value: %d\n",cur_line);     [delete lines ...]
fprintf(stdout,"Easting/Northing: %lf / %lf\n",s1->east,s1->north);*/

        /* deal with the fact that area edges can be labelled as lines too!! */
        if (cur_line == 0)
        {
          cur_line = dig_point_to_line(&(Curr_map.info), s1->east,
                                       s1->north, AREA);
          cur_type = AREA;
        }

/*fprintf(stdout,"Returned line value: %d\n",cur_line);*/     [... to here]
        read_write_line(s1, cur_line, &(Curr_map.info), cur_type,&new_vect_map,
                        fp_att, att_field_num, cat_field_num);
        break;
**********************************************************

[Edited version of cmd/vect_map.c should look like this begining
at line 233: ]
      case LINE_CHAR:
        /* get the line and add it to the binary vector file */
        cur_line = dig_point_to_line(&(Curr_map.info), s1->east,
                                     s1->north, LINE|AREA);
        cur_type = Curr_map.info.Line[cur_line].type;

        read_write_line(s1, cur_line, &(Curr_map.info), cur_type,&new_vect_map,
                        fp_att, att_field_num, cat_field_num);
        break;
***********************************************************

Then  be sure you are in directory .../src.garden/grass.rim/v.db.rim and
compile using gmake4.0  (Both the command version and the interactive
version of v.db.rim will be compiled with the changes.)

Hope this helps solve some problems.

Jim Hinthorne
CWU GIS Lab
Dave Gerdes
CERL



More information about the grass-user mailing list