Hi Radim,
thank you very much for your reply. I tried to apply this to another issue - a
polygon buffer theme with a donut polygon [1]. However, the solution
described by you also creates another centroid within the "hole" of the
polygon. Any ideas?
Best regards,
Wolfgang
[1] http://grass.itc.it/pipermail/grassuser/2006-January/032130.html
--8<------------------------------------------------------------------------------------------------
Am Mittwoch 25 Januar 2006 pH:23:11 vormittags schrieb Radim Blazek:
On 1/24/06, René Capell <rene.ca@web.de> wrote:
> Hi Wolfgang,
>
> actually I am a little bit confused, because i thought categories MUST
> be unique (I=beginner), but if I understood your problem right,
> v.category should do it:
>
> v.category in=stream option=del
> v.category in=stream option=add step=1
Categories does not have to be unique. More elements in map can be linked
to single database row. This is similar to multi* features in simple
features.
In this particular cas the category in streams probably have some meaning.
Suggested v.category del/add will work but the information is lost.
If you want a single row for each line you can assign new cats in a new
layer v.category in=stream output=stream2 layer=2
and create and connect 2 tables:
echo "create table stream2_1 (cat int)" | db.execute
echo "create table stream2 _2 (cat int, cat_orig int)" | db.execute
db.connect map=stream2 layer=1 table=stream2_1
db.connect map=stream2 layer=2 table=stream2_2
v.to.db map=stream2 layer=1 option=cat
v.to.db map=stream2 layer=2 option=cat
and upload original categories to stream2 _2
v.to.db map=stream2 qlayer=1 layer=2 option=query qcol=cat col=cat_orig
Now you have in the layer 2 unique categories and values of original
categories are uploaded to the attribute table of layer 2.
Radim
> Greets, Rene
>
> >Hi list,
> >I tried to assign unique cat-values to a vector (copy of
> > streams@PERMANENT, spearfish dataset)file using v.to.db. I expected
> > each row to get a unique cat-value (1,2,3 ...), but received a
> > different result: in total I have three different values for cat (1,2
> > and 3 like 1,1,1,2,2,2,2,2,3,3,2,2,2,1). How can I assign unique
> > cat-values?
> >
> >Greetings,
> >
> >Wolfgang