[GRASS-user] v.edit split lines and create new record with UNIQUE category value

Enrico Gallo enrico.gallo at gmail.com
Sun Dec 19 18:13:09 EST 2010

Dear list,

I am managing a bulk cleaning of pseudo-network data, where nodes
"more o less" overlap links, but never break links itself (usually
links have no vertex near those nodes)

I am using v.distance between pseudo-nodes and links, followed by
parsing db.select output and then piping it to v.edit, tool=break

when trying to update links length, I realized something was wrong
because of identical CATs of links just edited

rebuilding theme was useless, because this way I lost attributes on
new elements, while I need to inherit all of them, except for length
same problem adding new cat on a different layer (this way I get a
unique cat field,  but I lost all attributes )

to update my length field I do really need a UNIQUE_value CAT, but I
found no other way to get a UNIQUE value CAT  than brutally exporting
theme in shp and reloading it using v.in.ogr

this post [1] suggest a similar issue on v.split

reading this paper [2] about v.edit, break and split seem different
tools (different record management?)
on the other hand, grass manuals of v.edit (6.4, 7.0) tell "break:
Break/split vector lines" like synonyms

is there a better/smarter way to solve this problem?

perhaps (but really complex):
1. parsing ids from v.edit where cat = old cat,
2. get last category in use
3. modify one item setting cat = last category +1,
4. insert new record on attribute table copying data  where cat = old
category and setting cat =  last category +1
5. re-connect data

or I am missing something about grass vector editing and categories management?

thank you


[1] http://www.mail-archive.com/grass-user@lists.osgeo.org/msg01509.html
[2] http://gislab.dirap.unipa.it/grass_meeting/articoli/grass-digit.pdf

More information about the grass-user mailing list