[GRASS-dev] [GRASS GIS] #3263: r.to.vect: option to filter raster values

#3263: r.to.vect: option to filter raster values
-------------------------------+-------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.4.0
Component: Raster | Version: svn-trunk
Keywords: r.to.vect, values | CPU: Unspecified
Platform: Unspecified |
-------------------------------+-------------------------
It would be useful to introduce for G72:r.to.vect `values` option
similarly to G72:d.rast for filtering raster values. Let's say that we
have viewshed map with two categories (1 - visible, 0 - invisible):

{{{
r.category viewA
0
1
}}}

We would like convert to vector map only visible areas. Currently we need
to run G72:r.mapcalc or G72:r.reclass to be able to perform this task:

{{{
r.mapcalc expr='viewA1 = if(viewA == 0, null(), 1)'
r.to.vect -sv input=viewA1 out=viewA type=area -t
}}}

With `values` option we could perform this task by running just one
command:

{{{
r.to.vect -sv input=viewA out=viewA type=area -t values=1
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3263&gt;
GRASS GIS <https://grass.osgeo.org>

#3263: r.to.vect: option to filter raster values
--------------------------+-------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.to.vect, values
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------------

Comment (by martinl):

The attached patch attachment:r-to-vect-values.diff shows quick & dirty
way of implementing `values` option for G72:r.to.vect. This patch takes
code from G72:`d.rast` module (`mask.c`, `mask.h` and `parselist.c`) which
is not acceptable because of code duplication. The duplicated code should
be moved to `libgis` for real implementation.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3263#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3263: r.to.vect: option to filter raster values
--------------------------+-------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.to.vect, values
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------------
Changes (by martinl):

* Attachment "r-to-vect-values.diff" added.

Dirty way of implementation values option for r.to.vect

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3263&gt;
GRASS GIS <https://grass.osgeo.org>

#3263: r.to.vect: option to filter raster values
--------------------------+-------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.to.vect, values
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------------

Comment (by mlennert):

+1

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3263#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3263: r.to.vect: option to filter raster values
--------------------------+-------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.8.0
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.to.vect, values
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------------
Changes (by martinl):

* milestone: 7.6.2 => 7.8.0

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3263#comment:8&gt;
GRASS GIS <https://grass.osgeo.org>