[GRASS-user] Vector map point deleted but still displays

   I removed a point from a vector map but it still shows up on the display
monitor (see attached screenshot, point #2). The attribute table no longer
contains that row:

cat|y|x|label
1|45.299844|-122.353975|USGS gauge
3|45.302761|-122.358851|Building

   I've tried to remove this point from the display using v.edit and the
vector editor in the GUI map display window. I've removed that features map
from the display and re-displayed it and killed the grass session and started a
new one, but that point #2 still shows up on the map.

   What have I done incorrectly?

Rich

(attachments)

screenshot.png

* Rich Shepard <rshepard@appl-ecosys.com> [2018-07-10 15:11:32 -0700]:

I removed a point from a vector map but it still shows up on the display
monitor (see attached screenshot, point #2). The attribute table no longer
contains that row:

cat|y|x|label
1|45.299844|-122.353975|USGS gauge
3|45.302761|-122.358851|Building

I've tried to remove this point from the display using v.edit and the
vector editor in the GUI map display window. I've removed that features map
from the display and re-displayed it and killed the grass session and started a
new one, but that point #2 still shows up on the map.

What have I done incorrectly?

Please post (also) the exact `v.edit` command.

Nikos

On Wed, 11 Jul 2018, Nikos Alexandris wrote:

Please post (also) the exact `v.edit` command.

Nikos,

   Very strange. Looking at the map now only one point is visible (cat #3)
while both cat #1 and #3 are shown in the attribute table. This means it's
time to g.remove that map and start over.

Regards,

Rich

On 11/07/18 16:48, Rich Shepard wrote:

On Wed, 11 Jul 2018, Nikos Alexandris wrote:

Please post (also) the exact `v.edit` command.

Nikos,

    Very strange. Looking at the map now only one point is visible (cat #3)
while both cat #1 and #3 are shown in the attribute table. This means it's
time to g.remove that map and start over.

Note that attribute table and geometries are independent. The cat values of your features are linked to the column defined as the key column in your attribute table connection (can be seen with v.db.connect -p).

You can have a vector map with features that have a cat value, but no corresponding entry in the attribute table, and you can have entries in the attribute table with no corresponding features in the map.

AFAIK, v.edit only modifies the map, not the attribute table. This is important as several features can potentially be linked to the same attributes. Just because you remove one of the features doesn't mean you necessarily want to remove the attributes. Maybe it might be a good idea to add an additional 'delete_with_attributes' tool to v.edit.

If you delete a feature with v.edit and also want to delete the corresponding line in the attribute table, you can run db.execute sql="delete from NameOfAttributeTable where cat=YourDeletedFeaturesCat"

If you want to erase a point completely (i.e. both the feature and the corresponding entry in the attribute table), the easiest currently is probably to use v.extract with the '-r' flag. This has the disadvantage of creating a new map, but this might actually be an advantage as it allows to go back to the original map if you make a mistake.

v.extract -r YourMap cat=YourFeaturesCat output=NewMap

Moritz

On Wed, 11 Jul 2018, Moritz Lennert wrote:

You can have a vector map with features that have a cat value, but no
corresponding entry in the attribute table, and you can have entries in
the attribute table with no corresponding features in the map.

Moritz,

   Yesterday, initially, there were three featurs on the map and three rows
in the attribute table. I tried removing the feature, but without success.

AFAIK, v.edit only modifies the map, not the attribute table. This is important as several features can potentially be linked to the same attributes. Just because you remove one of the features doesn't mean you necessarily want to remove the attributes. Maybe it might be a good idea to add an additional 'delete_with_attributes' tool to v.edit.

   I did delete the row in the attribute table. but v.edit refused to remove
the map feature. My experiences have been one feature/one attribute.
Regardless, adding a 'delete_with_attributes' option would be helpful.

If you want to erase a point completely (i.e. both the feature and the corresponding entry in the attribute table), the easiest currently is probably to use v.extract with the '-r' flag. This has the disadvantage of creating a new map, but this might actually be an advantage as it allows to go back to the original map if you make a mistake.

v.extract -r YourMap cat=YourFeaturesCat output=NewMap

   I'll remember this (by saving this message) if I need to remove a feature
in the future.

Best regards,

Rich