[GRASSLIST:7082] databases

Hi everyone,

I’ve just stumbled into the topic of using databases linked with GRASS. I’d like to start using mySQL to store and manage spatial data, but in spite of all the reading I’ve done (Tutorials, GRASS Wiki, etc), it is still unclear to me what exactly can and can not be stored in databases, and how. For those of you with experience, can you point me in the right direction? I have lots of experience with mySQL, so I’m comfortable with that topic. Here are my basic questions:

  1. Does having data in a database mean that it does not need to also be stored in GRASS files?

  2. Can any GRASS vector data be stored in a database, or is it just points?

  3. How is GRASS vector data put into a database? For example, I download a vector file for county boundaries from a state agency (polygons). I can easily import this into GRASS. Now what? Many of the tutorials focus on querying the database, but how to I load the data into the db table in the first place?

Thanks in advance for any assistance.

  • Jason

Jason Horn

Boston University Department of Biology

5 Cumington Street Boston, MA 02215

jhorn@bu.edu

office: 617 353 6987

cell: 401 588 2766

On Wed, Jun 08, 2005 at 12:27:10PM -0400, Jason Horn wrote:

Hi everyone,

I've just stumbled into the topic of using databases linked with
GRASS. I'd like to start using mySQL to store and manage spatial
data, but in spite of all the reading I've done (Tutorials, GRASS
Wiki, etc), it is still unclear to me what exactly can and can not be
stored in databases, and how. For those of you with experience, can
you point me in the right direction? I have lots of experience with
mySQL, so I'm comfortable with that topic. Here are my basic questions:

1) Does having data in a database mean that it does not need to also
be stored in GRASS files?

2) Can any GRASS vector data be stored in a database, or is it just
points?

3) How is GRASS vector data put into a database? For example, I
download a vector file for county boundaries from a state agency
(polygons). I can easily import this into GRASS. Now what? Many of
the tutorials focus on querying the database, but how to I load the
data into the db table in the first place?

This is done automagically by v.in.ogr (if the import format is supported
by OGR).
If you want to throw the attributes into a DB different from DBF file (default),
then use db.connect first:

http://grass.gdf-hannover.de/twiki/bin/view/GRASS/GrassSixTutorialAttributeManagement
-> Managing the default settings

Hope this helps

Markus

Thanks in advance for any assistance.

- Jason

Jason Horn
Boston University Department of Biology
5 Cumington Street Boston, MA 02215

jhorn@bu.edu
office: 617 353 6987
cell: 401 588 2766

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