[GRASS-dev] [GRASS GIS] #3679: Convert numeric raster category labels to numeric column in the output vector map's attribute table

GRASS GIS trac at osgeo.org
Sun Oct 7 07:20:33 PDT 2018


#3679: Convert numeric raster category labels to numeric column in the output
vector map's attribute table
------------------------------+-------------------------
 Reporter:  Nikos Alexandris  |      Owner:  grass-dev@…
     Type:  enhancement       |     Status:  new
 Priority:  minor             |  Milestone:
Component:  Default           |    Version:  unspecified
 Keywords:  r.to.vect         |        CPU:  Unspecified
 Platform:  Unspecified       |
------------------------------+-------------------------
 Converting a raster which holds category labels to vector using
 `r.to.vect`, i.e.
 {{{
 r.to.vect in=raster_map out=vector_map type=area
 }}}

 will add the columns `value` and `label`.
 {{{
 v.info -c vector_map
 Displaying column types/names for database connection of layer <1>:
 INTEGER|cat
 INTEGER|value
 CHARACTER|label
 }}}

 Since `r.mapcalc` supports for some math using numbers stored as category
 labels (via the @ operator) and, as well, `r.stats.zonal` writes numeric
 results as category labels via its `-r` flag, it would make sense to
 support for the addition of a numeric (int or double) column type in the
 output vector map's attribute table. Perhaps this could be done via a
 flag.

 I understand that this might bring a series of tests to perform before
 attempting adding such a column in the output attribute table. Such as
 "are all labels numeric?" and "should the output be 'int' or 'double'?".
 Yet, it would help to streamline processes that involve such conversions.

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



More information about the grass-dev mailing list