[GRASS-user] Trouble with v.db.join and sqlite
nikos.alexandris at felis.uni-freiburg.de
nikos.alexandris at felis.uni-freiburg.de
Fri May 30 07:37:39 EDT 2008
On Fri, 30 May 2008 04:17:51 -0700 (PDT)
doktoreas <thedoktor78 at gmail.com> wrote:
>
>
>
> Markus Neteler OSGeo wrote:
> >
> > Luca,
> >
> > can you replicate this with Spearfish or the NC data
> set?
> > Then we could easier test things...
> >
> > Markus
> >
> >
>
> Hi Markus,
>
> those are the steps to replicate the problem with NC
> dataset ( all is done
> in a new mapset called sqlite):
>
> db.connect driver=sqlite
> database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db'
> g.copy vect=urbanarea at PERMANENT,urbanarea
> v.extract -t input=urbanarea output=urban_point
> type=point,centroid
> v.db.addtable urban_point
>
> v.db.join map=urbanarea column=cat otable=urban_point
> ocolumn=cat
> ..
> DBMI-SQLite driver error:
> Error in sqlite3_prepare():
> duplicate column name: cat
>
> ERROR: Error while executing: 'ALTER TABLE urban_point
> ADD COLUMN cat
> INTEGER
> '
> ERROR: Cannot continue (problem adding column).
> ERROR: Cannot continue.
>
> Thanks for your help
>
> Luca
Luca,
v.db.join never worked for me when the columns had the same
name. I rename one of the columns and there is no problem.
I was also wondering if there is a reason for that or if it
is a bug.
in your case rename one of the "cat" columns to lets say
"cat_x" and do:
v.db.join map=urbanarea column=cat otable=urban_point
ocolumn=cat_x
Nikos
More information about the grass-user
mailing list