[GRASS-dev] [GRASS GIS] #2280: v.extract: allow random extraction based on feature ids, not only category values

GRASS GIS trac at osgeo.org
Mon May 5 00:32:27 PDT 2014


#2280: v.extract: allow random extraction based on feature ids, not only category
values
----------------------------------------------+-----------------------------
 Reporter:  mlennert                          |       Owner:  grass-dev@…              
     Type:  enhancement                       |      Status:  new                      
 Priority:  normal                            |   Milestone:  7.0.0                    
Component:  Vector                            |     Version:  svn-trunk                
 Keywords:  v.extract category values random  |    Platform:  Unspecified              
      Cpu:  Unspecified                       |  
----------------------------------------------+-----------------------------
 I have a point vector file over 400,000 points) without attribute table.
 The one relevant info is stored as a category value in layer 1.

 I would like to extract at random a subset of 50,000 points. v.extract
 random= seems like the ideal solution. However, there are only 687
 different category values and thus v.extract bails out with


 {{{
 ERREUR :Random category count is larger or equal to uniq
         <point,line,boundary,centroid,area,face> feature category count
 687
 }}}

 When I add category values to layer=2, I can then do the v.extract with
 random=50000, but it only extracts layer 2, so I lose the info in layer 1.

 I can see two solutions:

 - allow random selection in feature id space, not only in category space
 - add flag to keep info from all other layers when extracting (which then
 allows to do the extraction with the extra v.category step mentioned
 above)

 Moritz

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



More information about the grass-dev mailing list