Opened 8 years ago

Last modified 5 years 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 8 years ago.
Dirty way of implementation values option for r.to.vect

Download all attachments as: .zip

Change History (13)

comment:1 by martinl, 8 years ago

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.

by martinl, 8 years ago

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

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

comment:2 by mlennert, 8 years ago

+1

comment:3 by neteler, 7 years ago

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:4 by neteler, 6 years ago

Milestone: 7.4.17.4.2

comment:5 by martinl, 6 years ago

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

comment:6 by martinl, 6 years ago

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:7 by martinl, 6 years ago

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

comment:8 by martinl, 6 years ago

Milestone: 7.6.27.8.0

comment:9 by neteler, 5 years ago

Milestone: 7.8.07.8.1

Ticket retargeted after milestone closed

comment:10 by neteler, 5 years ago

Milestone: 7.8.17.8.2

Ticket retargeted after milestone closed

comment:11 by neteler, 5 years ago

Milestone: 7.8.2

Ticket retargeted after milestone closed

comment:12 by neteler, 5 years ago

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