Opened 3 years ago

Last modified 6 months ago

#3263 new enhancement

r.to.vect: option to filter raster values

Reported by: martinl Owned by: grass-dev@…
Priority: normal Milestone: 7.8.3
Component: Raster Version: svn-trunk
Keywords: r.to.vect, values Cc:
CPU: Unspecified Platform: Unspecified

Description

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 

Attachments (1)

r-to-vect-values.diff (9.6 KB) - added by martinl 3 years ago.
Dirty way of implementation values option for r.to.vect

Download all attachments as: .zip

Change History (13)

comment:1 Changed 3 years ago 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.

Changed 3 years ago by martinl

Attachment: r-to-vect-values.diff added

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

comment:2 Changed 3 years ago by mlennert

+1

comment:3 Changed 2 years ago by neteler

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:4 Changed 2 years ago by neteler

Milestone: 7.4.17.4.2

comment:5 Changed 21 months ago by martinl

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

comment:6 Changed 17 months ago by martinl

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:7 Changed 14 months ago by martinl

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

comment:8 Changed 14 months ago by martinl

Milestone: 7.6.27.8.0

comment:9 Changed 9 months ago by neteler

Milestone: 7.8.07.8.1

Ticket retargeted after milestone closed

comment:10 Changed 7 months ago by neteler

Milestone: 7.8.17.8.2

Ticket retargeted after milestone closed

comment:11 Changed 6 months ago by neteler

Milestone: 7.8.2

Ticket retargeted after milestone closed

comment:12 Changed 6 months ago by neteler

Milestone: 7.8.3
Note: See TracTickets for help on using tickets.