[GRASS-dev] [GRASS GIS] #3236: v.db.select mixes areas and other geometries resulting in a wrong region

GRASS GIS trac at osgeo.org
Sun Jan 1 11:56:12 PST 2017


#3236: v.db.select mixes areas and other geometries resulting in a wrong region
-------------------------+-------------------------
 Reporter:  marisn       |      Owner:  grass-dev@…
     Type:  defect       |     Status:  new
 Priority:  major        |  Milestone:  7.2.1
Component:  Vector       |    Version:  svn-trunk
 Keywords:  v.db.select  |        CPU:  Unspecified
 Platform:  Unspecified  |
-------------------------+-------------------------
 v.db.select with option "print region" calls Vect_cidx_find_all with type
 mask -1. This type mask matches lines and areas (see #3235). As a result -
 output of it will be IDs of lines and IDs of areas. Subsequent calls to
 Vect_get_line_type and Vect_get_line_box assume that Vect_cidx_find_all
 has returned only line IDs and thus will read wrong line for matching
 areas. The solution would be to change type mask to read "~GV_AREA"
 instead of "-1".

 I have not commited this as I would like if someone with greater
 understanding of CIDX to take a look at it at first (together with #3235).
 Here is sample data to test the issue. In both cases output should be
 identical, still, as you can see, for "bad" map it is wrong.
 {{{
 echo "ORGANIZATION: Maris N
 DIGIT DATE:   01/01/2017
 DIGIT NAME:   -
 MAP NAME:     fail
 MAP DATE:     2017
 MAP SCALE:    10000
 OTHER INFO:   Test polygons
 ZONE:  0
 MAP THRESH:   0.500000
 VERTI:
 B 4
  15 10
  10 10
  10 15
  15 15
 C 1 1
  12 12
  1 3
 C 1 1
  17 12
  1 4
 B 4
  15 10
  20 10
  20 15
  15 15
 B 2
  15 10
  15 15
 " | v.in.ascii in=- format=standard output=bad --o
 v.db.addtable map=bad

 echo "ORGANIZATION: Maris N
 DIGIT DATE:   01/01/2017
 DIGIT NAME:   -
 MAP NAME:     success
 MAP DATE:     2017
 MAP SCALE:    10000
 OTHER INFO:   Test polygons
 ZONE:  0
 MAP THRESH:   0.500000
 VERTI:
 B 4
  15 10
  10 10
  10 15
  15 15
 B 4
  15 10
  20 10
  20 15
  15 15
 B 2
  15 10
  15 15
 C 1 1
  12 12
  1 3
 C 1 1
  17 12
  1 4
 " | v.in.ascii in=- format=standard output=good --o
 v.db.addtable map=good

 v.db.select -r map=good where=CAT=4
 v.db.select -r map=bad where=CAT=4
 }}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3236>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list