[GRASS-user] Finding why postgres database cannot be opened

Rich Shepard rshepard at appl-ecosys.com
Wed Nov 7 14:44:59 PST 2018


On Wed, 7 Nov 2018, Rich Shepard wrote:

> Almost all issues are now resolved,

   The issues with specifying database paths and needing a filled cat column
in the stations table have been resolved. v.db.connect shows a valid
connection to the database table:

> v.db.connect map=stations -p
Vector map <stations> is connected by:
layer <1/stations> table <stations> in database
</home/rshepard/data/grassdata/willamette_basin/willamette-river-hg> through
driver <pg> with key <cat>

but, trying to display that map using v.colors in a script still fails to
find the database:

> $HOME/documents/white-papers/geochemistry/willamette-river-mercury/scripts/grass-display-sample-sites.sh
d.vect complete.
d.vect complete.
DBMI-PostgreSQL driver error:
Connection failed.
FATAL:  database "/home/rshepard/data/grassdata/willamette_basin/willamette-river" does not exist
WARNING: Unable to open database
          </home/rshepard/data/grassdata/willamette_basin/willamette-river-hg>
          by driver <pg>
ERROR: Unable to open database
        </home/rshepard/data/grassdata/willamette_basin/willamette-river-hg>
        by driver <pg>

   The script:
#!/usr/bin/bash

db.connect driver=pg database=willamette-river-hg
g.region vect=wrb
d.mon start=wx0
d.vect map=wrb col=black fill_col=none
d.vect map=wrb_rivers col=blue fill_col=blue
v.colors map=stations use=attr column=howmany rules=rules.txt rgb_col=bin_col --o

and the color rules file:

1 231:00:00
10 231:00:00
11 89:00:00
20 89:00:00
21 231:00:231
30 231:00:231
31 231:173:00
40 231:173:00
41 231:115:00
50 231:115:00
51 00:231:57
60 00:231:57
61 115:231:00
70 115:231:00

TIA,

Rich



More information about the grass-user mailing list