Opened 5 years ago

Last modified 4 years ago

#3699 new enhancement

v.extract: allow random extraction on subsets selected by where, cats and file options [PATCH]

Reported by: mlennert Owned by: grass-dev@…
Priority: normal Milestone: 7.8.3
Component: Vector Version: svn-trunk
Keywords: v.extract random Cc:
CPU: Unspecified Platform: Unspecified

Description

Currently, v.extract only allows the user to use one of where, cats, file and random. It can be useful, however, to be able to extract a random sample of vector features among all those corresponding to certain criteria, for example based on an attribute. The user can obviously first run v.extract based on that attribute and then run v.extract again to select a random sample in the result. However, this can be quite long, especially if the vector contains many attributes and so those have to be written at each step.

The applied patch modifies v.extract to allow random sampling even among a subset defined by the other three options. This would allow running extractions such as the following (which extracts a random sample of census blocks amongst those blocks that actually have population in them):

v.extract censusblk_swwake where="TOTAL_POP>0" random=200 out=test

If there are no objections, I will apply this patch to trunk, soon.

Attachments (1)

v_extract_random_with_others.diff (4.1 KB ) - added by mlennert 5 years ago.
patch to allow random sampling among subsets

Download all attachments as: .zip

Change History (5)

by mlennert, 5 years ago

patch to allow random sampling among subsets

comment:1 by neteler, 5 years ago

Milestone: 7.8.07.8.1

Ticket retargeted after milestone closed

comment:2 by neteler, 4 years ago

Milestone: 7.8.17.8.2

Ticket retargeted after milestone closed

comment:3 by neteler, 4 years ago

Milestone: 7.8.2

Ticket retargeted after milestone closed

comment:4 by neteler, 4 years ago

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