[GRASS-dev] Vlib: how to delete an object from a GRASS vector map

Martin Landa landa.martin at gmail.com
Sat Aug 23 11:20:25 EDT 2008


Hi,

2008/8/23 Markus Neteler <neteler at osgeo.org>:
> On Thu, Aug 21, 2008 at 6:54 PM, Benjamin Ducke
> <benjamin.ducke at oxfordarch.co.uk> wrote:
>> I am struggling to understand how to delete an object, including its
>> attached attributes, from a GRASS vector map.
>>
>> I open the map with:
>>
>> Vect_open_update ( &Map, MAPS[i].tempname, mapset );
>>
>> Then I find the category IDs of the objects I want to delete and then I
>> do:
>>
>> Vect_delete_line ( &Map, cat );
>> Vect_field_cat_del ( Cats, field, cat );

the second argument of Vect_delete_line() is feature id not category.
Feature ids start at 1. You get number of features by
Vect_get_num_lines().

Good luck, Martin

-- 
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *


More information about the grass-dev mailing list