Opened 6 years ago

Last modified 15 months ago

#2280 new enhancement

v.extract: allow random extraction based on feature ids, not only category values

Reported by: mlennert Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: Vector Version: svn-trunk
Keywords: v.extract category values random Cc:
CPU: Unspecified Platform: Unspecified

Description

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

Change History (8)

comment:1 Changed 4 years ago by martinl

Milestone: 7.0.07.0.5

comment:2 Changed 4 years ago by martinl

Milestone: 7.0.57.3.0

comment:3 Changed 4 years ago by martinl

Milestone: 7.3.07.4.0

Milestone renamed

comment:4 Changed 2 years ago by neteler

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:5 Changed 2 years ago by neteler

Milestone: 7.4.17.4.2

comment:6 Changed 22 months ago by martinl

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

comment:7 Changed 18 months ago by martinl

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:8 Changed 15 months ago by martinl

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.