[GRASS-dev] [GRASS GIS] #3699: v.extract: allow random extraction on subsets selected by where, cats and file options [PATCH]

GRASS GIS trac at osgeo.org
Fri Nov 23 09:49:51 PST 2018


#3699: v.extract: allow random extraction on subsets selected by where, cats and
file options [PATCH]
------------------------------+-------------------------
 Reporter:  mlennert          |      Owner:  grass-dev@…
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:  7.8.0
Component:  Vector            |    Version:  svn-trunk
 Keywords:  v.extract random  |        CPU:  Unspecified
 Platform:  Unspecified       |
------------------------------+-------------------------
 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.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/3699>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list