Opened 16 years ago
Closed 16 years ago
#229 closed enhancement (fixed)
v.random: add random sampling from vector points map
Reported by: | neteler | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 6.4.0 |
Component: | Default | Version: | svn-trunk |
Keywords: | vector | Cc: | |
CPU: | All | Platform: | All |
Description
In v.random, there is no possibility to do random sampling from a vector points map (as r.random does). I have seen that most vector code is already in
raster/r.random/random.c
incl DBMS support since r.random also support vector points (but only from *raster* maps). Maybe not a big issue for someone familiar with vector/DBMS...
Markus
Change History (2)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Maris wrote:
v.extract now supports extraction of N random categories matching vector features. To extract N points, simply provide random=N option. Current implementation has one small(?) problem - it operates on CAT's and not feature ID's and thus will extract ALL features matching randomly selected CAT values.
He implemented it in r33639. Tested and works fine.
Thanks, Maris,
Markus
The idea to use separately v.random and v.what.vect fails as it introduces new data points:
while it should subset existing data points.
Suggestion: maybe better use v.extract and add a "random=" parameter there which populates internally the "list=" list of categories?
Markus