Opened 8 years ago

Last modified 3 years ago

#2309 new enhancement

Add a select all flag to v.edit

Reported by: wenzeslaus Owned by: grass-dev@…
Priority: trivial Milestone: 7.6.2
Component: Vector Version: svn-trunk
Keywords: v.edit, feature selection Cc:
CPU: Unspecified Platform: All

Description

There is no explicit and documented possibility to select all features when editing using G7:v.edit. This make sense if you edit categories (not geometry) and you want to change the category for all features.

Perhaps -a Select all flag would be a clear way how to say that I want all features.

Currently you can use the trick with -r Reverse selection flag but it is not readable, intuitive and it is not clear if this behavior is supported.

Another possible workaround is to get bbox by v.info -g and pass it as polygon parameter (ticket:2304#comment:2). This seems inconvenient to me (in Python or in GUI).

Parent ticket: #2304

Example

Prepare test data:

v.in.ascii input=- output=test separator=comma <<EOF
913240.0,250614.0
913250.0,250628.0
EOF

We do not select any features, so selection is empty but we use -r flag to reverse selection:

v.edit -r map=test tool=catadd layer=2 cats=10 

There should be a feature in layer 2 with category 10.

v.what map=test coordinates=913240.0,250614.0
East: 913240
North: 250614
------------------------------------------------------------------
Map: test
Mapset: jr_contours
Type: Point
Id: 1
Layer: 1
Category: 1
Layer: 2
Category: 10

Attachments (1)

v_edit_select_all.diff (2.0 KB ) - added by mlennert 7 years ago.

Download all attachments as: .zip

Change History (13)

by mlennert, 7 years ago

Attachment: v_edit_select_all.diff added

comment:1 by mlennert, 7 years ago

I've attached a patch that provides a very simplistic approach to a "select all" flag. However, reflection is needed on the following questions:

  • Should the flag select all features, regardless of whether they have a category number of not ?
  • If not should the flag select only features that have category numbers in a given layer ?

I'm sure there are other questions like that that I haven't even thought about...

comment:2 by wenzeslaus, 7 years ago

I added a simple test in Bash which currently uses the -r flag as described in the original report. It would use some review. I'm not really familiar with format of v.category output.

To test run:

cd vector/v.edit/testsuite
./select_all_flag.sh

in reply to:  1 comment:3 by wenzeslaus, 7 years ago

Replying to mlennert:

I've attached a patch that provides a very simplistic approach to a "select all" flag.

Thanks.

However, reflection is needed on the following questions:

  • Should the flag select all features, regardless of whether they have a category number of not ?
  • If not should the flag select only features that have category numbers in a given layer ?

In the example in the original report, the layer option is used to specify the layer to write the categories to, so it cannot be used for selection, so there is no "given layer". And since there is no given layer, there is no way to determine if the features have category or not. So for me the answer for both questions is select regardless of existing category. This will do well for simple cases, I'm not sure if there are any complicated cases when a more sophisticated approach would be appropriate.

comment:4 by neteler, 6 years ago

Milestone: 7.1.07.2.0

Milestone renamed

comment:5 by neteler, 6 years ago

Milestone: 7.2.07.2.1

Ticket retargeted after milestone closed

comment:6 by martinl, 5 years ago

Milestone: 7.2.17.2.2

comment:7 by martinl, 5 years ago

Milestone: 7.2.27.4.0

All enhancement tickets should be assigned to 7.4 milestone.

comment:8 by neteler, 5 years ago

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:9 by neteler, 4 years ago

Milestone: 7.4.17.4.2

comment:10 by martinl, 4 years ago

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

comment:11 by martinl, 4 years ago

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:12 by martinl, 3 years ago

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.