landam / grass-gis-git-migration-test

0 stars 0 forks source link

Add a select all flag to v.edit #118

Open landam opened 5 years ago

landam commented 5 years ago

Reported by wenzeslaus on 23 May 2014 14:34 UTC There is no explicit and documented possibility to select all features when editing using https://grass.osgeo.org/grass77/manuals/v.edit. This make sense if you edit categories (not geometry) and you want to change the category for all features. .htmlPerhaps -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: https://trac.osgeo.org/grass/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

GRASS GIS version and provenance

svn-trunk

Migrated-From: https://trac.osgeo.org/grass/ticket/2309

landam commented 5 years ago

Attachment from mlennert on 16 Jun 2015 11:47 UTC

https://trac.osgeo.org/grass/attachment/ticket/2309/v_edit_select_all.diff

landam commented 5 years ago

Comment by mlennert on 16 Jun 2015 11:49 UTC I've attached a patch that provides a very simplistic approach to a "select all" flag. However, reflection is needed on the following questions:

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

landam commented 5 years ago

Comment by wenzeslaus on 16 Jun 2015 15:30 UTC 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
landam commented 5 years ago

Comment by wenzeslaus on 16 Jun 2015 15:37 UTC Replying to [comment:1 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.

landam commented 5 years ago

Comment by neteler on 5 May 2016 14:08 UTC Milestone renamed

landam commented 5 years ago

Comment by neteler on 28 Dec 2016 15:04 UTC Ticket retargeted after milestone closed

landam commented 5 years ago

Modified by @landam on 5 May 2017 20:41 UTC

landam commented 5 years ago

Comment by @landam on 1 Sep 2017 20:28 UTC All enhancement tickets should be assigned to 7.4 milestone.

landam commented 5 years ago

Comment by neteler on 26 Jan 2018 11:40 UTC Ticket retargeted after milestone closed

landam commented 5 years ago

Modified by neteler on 12 Jun 2018 20:48 UTC

landam commented 5 years ago

Comment by @landam on 25 Sep 2018 16:53 UTC All enhancement tickets should be assigned to 7.6 milestone.

landam commented 5 years ago

Comment by @landam on 25 Jan 2019 21:08 UTC Ticket retargeted after milestone closed