g.copy vect=ammprv,pat_ammprv
COPY [ammprv@PERMANENT] to current mapset as [pat_ammprv]
DBMI-DBF driver error:
Cannot open dbf database: /ssi0/ssi/neteler/grassdata/pat/export/dbf/
WARNING: Cannot open database '/ssi0/ssi/neteler/grassdata/pat/export/dbf/'
no database is open
WARNING: Cannot copy table
WARNING: Cannot copy ammprv@PERMANENT to current mapset as pat_ammprv
Yes, I know, that the user has to create this directory first. But
this could also be done by the program.
So, where to apply a code modification:
- db.connect - when using dbf driver?
- g.copy/g.rename - when using dbf driver ?
g.copy vect=ammprv,pat_ammprv
COPY [ammprv@PERMANENT] to current mapset as [pat_ammprv]
DBMI-DBF driver error:
Cannot open dbf database: /ssi0/ssi/neteler/grassdata/pat/export/dbf/
WARNING: Cannot open database '/ssi0/ssi/neteler/grassdata/pat/export/dbf/'
no database is open
WARNING: Cannot copy table
WARNING: Cannot copy ammprv@PERMANENT to current mapset as pat_ammprv
Yes, I know, that the user has to create this directory first. But
this could also be done by the program.
The directory is created automatically if no driver/databvase is defined and a vector module has to write a new table.
If a user takes the responsability to define the database, he must also create it.
So, where to apply a code modification:
- db.connect - when using dbf driver?
- g.copy/g.rename - when using dbf driver ?
I'd vote for g.copy. You need to have the dbf directory in existence for
some modules to put something into. That is, you need it before there is
anything IN it to connect with.
Michael
______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402
USA
From: Markus Neteler <neteler@itc.it>
Date: Thu, 21 Apr 2005 15:27:20 +0200
To: grass5 developers list <grass5@grass.itc.it>
Subject: [GRASS5] db.connect and auto-creation of dbf/ directory
Hi,
when using db.connect to define in a new mapset the DB connection,
I face following non-feature:
g.copy vect=ammprv,pat_ammprv
COPY [ammprv@PERMANENT] to current mapset as [pat_ammprv]
DBMI-DBF driver error:
Cannot open dbf database: /ssi0/ssi/neteler/grassdata/pat/export/dbf/
WARNING: Cannot open database '/ssi0/ssi/neteler/grassdata/pat/export/dbf/'
no database is open
WARNING: Cannot copy table
WARNING: Cannot copy ammprv@PERMANENT to current mapset as pat_ammprv
Yes, I know, that the user has to create this directory first. But
this could also be done by the program.
So, where to apply a code modification:
- db.connect - when using dbf driver?
- g.copy/g.rename - when using dbf driver ?
On Thu, Apr 21, 2005 at 02:33:25PM -0700, Michael Barton wrote:
I'd vote for g.copy. You need to have the dbf directory in existence for
some modules to put something into. That is, you need it before there is
anything IN it to connect with.
Excuse me, I don't understand your vote. You vote for leaving
this as-is? In the direction of Radim's comment?
Markus
> From: Markus Neteler <neteler@itc.it>
> Date: Thu, 21 Apr 2005 15:27:20 +0200
> To: grass5 developers list <grass5@grass.itc.it>
> Subject: [GRASS5] db.connect and auto-creation of dbf/ directory
>
> Hi,
>
> when using db.connect to define in a new mapset the DB connection,
> I face following non-feature:
>
> db.connect driver=dbf database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/'
> db.connect -p
> driver:dbf
> database:$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
> schema:(null)
> group:(null)
>
> So far so nice. But:
>
> g.copy vect=ammprv,pat_ammprv
> COPY [ammprv@PERMANENT] to current mapset as [pat_ammprv]
> DBMI-DBF driver error:
> Cannot open dbf database: /ssi0/ssi/neteler/grassdata/pat/export/dbf/
>
> WARNING: Cannot open database '/ssi0/ssi/neteler/grassdata/pat/export/dbf/'
> no database is open
> WARNING: Cannot copy table
> WARNING: Cannot copy ammprv@PERMANENT to current mapset as pat_ammprv
>
> Yes, I know, that the user has to create this directory first. But
> this could also be done by the program.
>
> So, where to apply a code modification:
> - db.connect - when using dbf driver?
> - g.copy/g.rename - when using dbf driver ?
>
> Markus
>
--
Markus Neteler <neteler itc it> http://mpa.itc.it
ITC-irst - Centro per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18 - 38050 Povo (Trento), Italy
> > when using db.connect to define in a new mapset the DB connection,
> > I face following non-feature:
> >
> > db.connect driver=dbf
> > database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/' db.connect -p
> > driver:dbf
> > database:$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
> > schema:(null)
> > group:(null)
> >
> > So far so nice. But:
> >
> > g.copy vect=ammprv,pat_ammprv
> > COPY [ammprv@PERMANENT] to current mapset as [pat_ammprv]
> > DBMI-DBF driver error:
> > Cannot open dbf database:
> > /ssi0/ssi/neteler/grassdata/pat/export/dbf/
> >
> > WARNING: Cannot open database
> > '/ssi0/ssi/neteler/grassdata/pat/export/dbf/' no database is open
> > WARNING: Cannot copy table
> > WARNING: Cannot copy ammprv@PERMANENT to current mapset as
> > pat_ammprv
> >
> > Yes, I know, that the user has to create this directory first. But
> > this could also be done by the program.
> >
> > So, where to apply a code modification:
> > - db.connect - when using dbf driver?
> > - g.copy/g.rename - when using dbf driver ?
Just to point out where this bites me: v.in.garmin creates a new vector
file with 'v.in.ascii type=standard'. It then makes a table with
db.execute:
if its a new mapset with e.g., no dbf/ or VAR, you get this error:
ERROR: No db connection for driver <(null)> defined. Run db.connect
Understandable, but still not very nice for the end-user who just wants
it to be created automatically if it doesn't exist. Maybe db.execute is
a "raw" command so people using it must do so at their own
responsibility. 'v.in.ascii format=points' does create DB link/folder if
needed automatically, which is nice.
If I add in DB checking logic to v.in.garmin before trying to create a
table does it make everyone happy or does an issue still remain?
ie should
db.connect driver=dbf database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/'
make sure that '$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/' exists for the
driver=dbf case, as it will just mean a mkdir?
I still don't understand how db.connect sees database='$MAPSET' without
`eval g.gisenv` ... internal?