[GRASS-dev] [GRASS GIS] #229: v.random: add random sampling from vector points map

#229: v.random: add random sampling from vector points map
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@lists.osgeo.org
     Type: enhancement | Status: new
Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Keywords: vector | Platform: All
      Cpu: All |
-------------------------+--------------------------------------------------
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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/229&gt;
GRASS GIS <http://grass.osgeo.org>

#229: v.random: add random sampling from vector points map
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: | Keywords: vector
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by neteler):

The idea to use separately v.random and v.what.vect fails as it introduces
new data points:

{{{
v.info -c lidar1map
g.region vect=lidar1map
v.random output=random_samples10 n=3800 --o
v.db.addtable map=random_samples10 columns='cat integer, height double
precision'
v.what.vect vector=random_samples10 column=height qvector=lidar1map
qcolumn=N3 dmax=100
}}}

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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/229#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#229: v.random: add random sampling from vector points map
--------------------------+-------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: closed
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Resolution: fixed | Keywords: vector
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Changes (by neteler):

  * status: new => closed
  * resolution: => fixed

Comment:

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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/229#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>