[GRASS-user] How to manipulate PostGIS attributes from GRASS

Micha Silver micha at arava.co.il
Sun Apr 18 05:58:02 EDT 2010


I have a PostGIS point layer. I've added an elevation column and I want 
to insert values for elevation using v.what.rast . What's the best way 
to do this?

I tried:
1- v.external, but that's a read only connection.
2- v.in.ogr -t (to avoid creating a duplicate table), then v.db.connect 
to reconnect to the original PostGIS table. But that's *wrong* since 
there's no way that I can see to connect the cat values to the data 
table id column.
Finally I did:
3- db.connect (to the PostGIS database)
v.in.ogr dsn="PG:..." layer=orig_table out=new_table
to create a new attrib table in Postgresql (geometry in GRASS)
v.what.rast on the new vector to get elevation values into the new 
attrib table,
then using a postgres update statement I copied the elevation attributes 
from the new table to the original. This does work OK.

Is there smoother way?
Thanks,
Micha

-- 
Micha Silver
http://www.surfaces.co.il/
Arava Development Co.  +972-52-3665918

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20100418/3198e5b9/attachment.html


More information about the grass-user mailing list