Opened 6 years ago
Last modified 5 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: | |
---|---|---|---|
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)
Change History (5)
by , 6 years ago
Attachment: | v_extract_random_with_others.diff added |
---|
comment:4 by , 5 years ago
Milestone: | → 7.8.3 |
---|
patch to allow random sampling among subsets