[GRASS-user] Can't dissolve based on column?

Patton, Eric epatton at nrcan.gc.ca
Wed Jan 16 22:26:45 EST 2008


Eric Patton wrote:
> > Just a clarification...so it's the case that the column parameter
> > in v.dissolve must always be of type integer, and *only* integer?

Hamish:
>The v.dissolve script with dissolve based on a column currently
>requires that column to be of type integer. We should probably add a
>check in the script for that (v.info -c).

Ok, that's what I thought; thanks. I wanted to make sure before I added a hint in the docs.
Actually, I think Nikos mentioned something about writing up a hint about it, so I'll hold off.

>It would be possible to add any type of column to v.dissolve with unix
>tools 'db.select | sort | uniq | nl' then create a new table with the
>unique attributes + sequential integer column, then v.reclass as
>before.

>or add a new column to (a copy of) the existing table (v.db.addcol) and
>populate it with a 'db.select | sort | uniq' loop and v.db.update, or
>SQL + db.execute << "set DISOLVEKEY = $i where ATTRIBUTE = '$VAL'"
>(sorry my SQL is not good but you may be the idea of what I mean)

Cool. It's always amazing how powerful these little command line tools can be.

~ Eric.



More information about the grass-user mailing list