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

Moritz Lennert mlennert at club.worldonline.be
Wed Jul 11 08:26:19 PDT 2018


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


More information about the grass-user mailing list