[GRASS-user] I'm in a hole and want to stop digging

Rich Shepard rshepard at appl-ecosys.com
Tue Jul 26 18:03:11 EDT 2011


   I'm starting a very large project that involves GRASS, R, and postgres and
I'm running into difficulties just trying to copy vectors and rasters from
the PERMANENT mapset into a project-specific mapset. (Setting the region
also is giving me issues, as will become clear in my explanation.) All this
with -6.5svn on linux.

   I have DEM raster data and some vector data stored in the internal GRASS
.dbf format. The rest of the vector data are postgres tables. When I invoke
grass65, I immediately run 'db.connect driver=pg database=nevada' so g.list
vect shows me all vector map tables. But, it does not distinguish between
those in postgres and those in GRASS.

   An example: looking at the output of 'g.list vect' I see the county
boundary ('county_bnd'), but a table list in postgres shows 'county_bnd_arc'
and 'county_bnd_lab'. When I try to use g.copy I get errors whether I use
'county_bnd' or 'county_bnd_arc'. So, I put that aside and try to copy map
huc10:

GRASS 6.5.svn (Nevada-SPCS):~/grassdata > g.copy vect=huc10 at PERMANENT,huc10
Copy vector <huc10 at PERMANENT> to current mapset as <huc10>
DBMI-Postgres driver error:
Cannot create table:
create table huc10 ( cat integer, gaz_id integer, area_acres double
precision, area_sqkm double precision, states varchar(50), loaddate
varchar(10), huc_10 varchar(10), hu_10_name varchar(120), hu_10_type
varchar(1), hu_10_mod varchar(50), shape_leng double precision, shape_area
double precision )
ERROR:  relation "huc10" already exists


WARNING: Unable to create table <huc10>
WARNING: Unable to copy table <huc10>
WARNING: Cannot copy <huc10 at PERMANENT> to current mapset as <huc10>

   Well, huc10 _does_ exist in postgres (I imported it to the PERMANENT
mapset), but it's not available in the jerritt mapset.

   Because working with both the internal and an external dbms for vector
data is new to me I'd greatly appreciate pointers to what I need to read to
learn how to get past this hurdle so I can motor up to the next hurdle.
There's a lot of learning on my part, and client pressure to start producing
analytical results.

Rich




More information about the grass-user mailing list