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

Hamish hamish_b at yahoo.com
Wed Jan 16 18:46:21 EST 2008


Nikos Alexandris wrote:
> For the moment I don't have any other datasets than the CORINE
> shapefile(s) tiles and it worked only after this change ("TEXT" to
> "integer").

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?


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).

v.dissolve with column= calls v.reclass to change the key column from
the usual 'cat' column to something else. By definition the key column
must be type integer.

v.reclass options help:
  column   The name of the column values of which are used as new
categories. The column must be type integer.



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)


actually, I kind of thought Markus had already coded it like that.
Guess not.


Hamish



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 




More information about the grass-user mailing list