[GRASS-dev] getting from DBF to SQLite

I have some vector files with attribute tables in DBF format. I would like to copy them and move their tables into SQLite. How is the easiest way to do that.

I thought I could just set db.connect to sqlite and copy the vectors, but that doesn’t seem to work.

Michael


C. Michael Barton
Visiting Scientist, Integrated Science Program
National Center for Atmospheric Research &
University Corporation for Atmospheric Research
303-497-2889 (voice)

Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

2012/3/26 Michael Barton <Michael.Barton@asu.edu>:

I thought I could just set db.connect to sqlite and copy the vectors, but
that doesn't seem to work.

in which sense it doesn't work?

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

On Mar 26, 2012, at 11:15 AM, Martin Landa wrote:

2012/3/26 Michael Barton <Michael.Barton@asu.edu>:

I thought I could just set db.connect to sqlite and copy the vectors, but
that doesn't seem to work.

in which sense it doesn't work?

Thanks Martin,

Here is what happens. Perhaps this does not work in GRASS 6.4.3? I just noticed that the sqlite selection in the GUI for db.connect does not do anything.

GRASS 6.4.3svn (Spain_utm_ed50z30):~ > db.connect driver=sqlite
GRASS 6.4.3svn (Spain_utm_ed50z30):~ > g.copy vect=alcala_subsect@Alcala_vectors,alcala_subsect_sqlite
Copy vector <alcala_subsect@Alcala_vectors> to current mapset as
<alcala_subsect_sqlite>
DBMI-SQLite driver error:
Unable to open database: unable to open database file

WARNING: Unable to open database
         </Users/Shared/grassdata/Spain_utm_ed50z30/SAA2012/dbf/> by driver
         <sqlite>
no database is open
WARNING: Unable to copy table <alcala_subsect_sqlite>
WARNING: Cannot copy <alcala_subsect@Alcala_vectors> to current mapset as
         <alcala_subsect_sqlite>

Michael

Martin

--
Martin Landa <landa.martin gmail.com> * Studijní program Geodézie a kartografie – GeoWikiCZ

_____________________
C. Michael Barton
Visiting Scientist, Integrated Science Program
National Center for Atmospheric Research &
University Corporation for Atmospheric Research
303-497-2889 (voice)

Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

2012/3/26 Michael Barton <Michael.Barton@asu.edu>:

GRASS 6.4.3svn (Spain_utm_ed50z30):~ > db.connect driver=sqlite

you need to define also database (file). Typically
`$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db`

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

I thought I did that, but will try again with your line copied exactly. Thanks

Michael

On Mar 26, 2012, at 11:27 AM, Martin Landa wrote:

2012/3/26 Michael Barton <Michael.Barton@asu.edu>:

GRASS 6.4.3svn (Spain_utm_ed50z30):~ > db.connect driver=sqlite

you need to define also database (file). Typically
`$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db`

Martin

--
Martin Landa <landa.martin gmail.com> * Studijní program Geodézie a kartografie – GeoWikiCZ

_____________________
C. Michael Barton
Visiting Scientist, Integrated Science Program
National Center for Atmospheric Research &
University Corporation for Atmospheric Research
303-497-2889 (voice)

Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

This worked. I must have specified it incorrectly the first time.

Thanks

On Mar 26, 2012, at 11:27 AM, Martin Landa wrote:

2012/3/26 Michael Barton <Michael.Barton@asu.edu>:

GRASS 6.4.3svn (Spain_utm_ed50z30):~ > db.connect driver=sqlite

you need to define also database (file). Typically
`$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db`

Martin

--
Martin Landa <landa.martin gmail.com> * Studijní program Geodézie a kartografie – GeoWikiCZ

_____________________
C. Michael Barton
Visiting Scientist, Integrated Science Program
National Center for Atmospheric Research &
University Corporation for Atmospheric Research
303-497-2889 (voice)

Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu