[GRASS-dev] [GRASS GIS] #3235: Vect_cidx_find_all should not allow mixing GV_AREA with other geometries

GRASS GIS trac at osgeo.org
Thu Jan 5 13:22:04 PST 2017


#3235: Vect_cidx_find_all should not allow mixing GV_AREA with other geometries
--------------------------+-------------------------
  Reporter:  marisn       |      Owner:  grass-dev@…
      Type:  defect       |     Status:  new
  Priority:  major        |  Milestone:  7.2.1
 Component:  LibVector    |    Version:  svn-trunk
Resolution:               |   Keywords:
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+-------------------------

Comment (by mmetz):

 Replying to [ticket:3235 marisn]:
 > At the moment Vect_cidx_find_all accepts any type mask. This leads to
 unusable results in case if typemask allows both GV_LINES and GV_AREA in
 the output. Reason - Vect_cidx_find_next will return line ID for GV_LINES
 and area ID for GV_AREA. As both ID spaces are separate (thus might
 contain identical ID values), mixing them in a single output structure is
 a road to disaster.

 That really is a disaster. The original implementation of the category
 index did not take into account that area categories are added to the
 category index. Probably because this is duplicate information, an area
 can only have category values if it has a centroid with category values.
 >
 > The fix - Vect_cidx_find_all should fail to accept type mask matching
 GV_LINES and GV_AREA (other combinations?) simultaneously.
 > Other option - change Vect_cidx_find_all to modify two structs - one
 with line IDs and other with area IDs.

 The real fix would be to not add area category values to the category
 index at all and update modules accordingly. This would be a substantial
 change in the vector libraries, but it can be implemented without breaking
 compatibility with G7. That would be a bit of work but I think it is worth
 the effort because it avoids ID collision.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3235#comment:1>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list