[GRASS-user] Joining vectors by location
lee at isi-solutions.org
Thu Nov 24 11:18:35 EST 2011
> IIRC, geography_columns is a view, not sure why you would even want to
> access that...
> I don't have time right now to try to find out where the error message
> comes from. Can you give us the exact v.in.ogr command you use ?
Gotcha. I think it is a table, actually:
List of relations
Schema | Name | Type | Owner
public | geometry_columns | table | lee
public | spatial_ref_sys | table | lee
This is my test DB that I'm using to kind of experiment and those are the
two tables that were produced as I was setting up the PostGIS DB.
Nonetheless, I don't necessarily want to access those tables, I just want
to upload my vectors. This is the v.out.ogr command I used:
v.out.ogr in=Gebaeude_Globalstrahlung dsn=’PG:host=localhost dbname=test
user=lee password=XXX type=area format=PostgreSQL’
Could it be that you're confusing two things:
> 1- Configure GRASS to use a PostgreSQL database for attribute data
> 2- Move your vector layers out to a PostGIS spatial database
> These are not the same. If you want to export a GRASS layer out to a
> PostGIS DB then v.out.ogr is the right module.
> If, on the other hand, you want to keep your data as GRASS vectors, but
> move the *attributes* to PostgreSQL then do:
> (straight from the man page...)
> db.connect driver=pg database="host=myserver.itc.it,dbname=mydb"
> db.login user=myname [pass=secret]
> db.connect -p
> This will set your default database connection to PostgreSQL, instead of
> dbf. Now you should copy your vectors to a new name in the mapset, and let
> GRASS make the Postgresql attribute tables.
> g.copy <vector1>,<newvector1>
> The new copies will still be GRASS vectors, but with their attribs in
> PostgreSQL database.
Okay, I hadn't understood the difference so well, but I think I get it a
little bit more. The table join would also work in PostgreSQL, that's true,
although I would rather have the data as PostGIS vectors. The reason I'd
like PostGIS vectors is because I want to show them with a Geoserver that
accesses PostGIS layers.
> ERROR 1: ERROR: permission denied for relation geography_columns
> This is a permissions prob within PostGIS... You need to GRANT ALL ON
> geography_columns TO <username>;
Just tried it. As my username (lee) I got:
test=> GRANT ALL ON geography_columns TO lee;
ERROR: permission denied for relation geography_columns
I tried it again then as postgres:
test=# GRANT ALL ON geography_columns TO lee;
Looked all right, but GRASS still gives me the same error that I don't have
permission for the relation geography_columns.
Any ideas? I also considered exporting everything as a shapefile and then
using shp2pgsql to import everything, but that's not a great solutions...
And plus, shapefiles have a restricted size, which could make things
difficult with large datasets (some of the data I work with is very large).
Thanks a lot for the help, I really appreciate it!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the grass-user