[GRASS-user] db.out.ogr Clarification

Daniel Lee lee at isi-solutions.org
Wed Mar 21 03:40:48 EDT 2012


Hi there,

My experience is that it sometimes works better to export the vectors from
GRASS as a shapefile and then use shp2pgsql to convert it. I scripted that
way of exporting long ago, so I can't remember exactly the rationale behind
it. If I remember correctly, the reason was that some polygons that I tried
to export were eliminated from the PostGIS table, but I'm honestly not too
sure any more.

If you're just wanting the table, though, I think db.out.ogr is a good way
to go. The command looks good to me, but in your example command, you write
"in=" rather than "input=". Perhaps that's the problem. Also, does your DB
allow write access for every user? Since you have neither username or
password, it could be that the database is rejecting your query. If you
haven't tried it yet, give it a shot and let us know how it goes ;)

Best,
Daniel

--

B.Sc. Daniel Lee
Geschäftsführung für Forschung und Entwicklung
ISIS - International Solar Information Solutions GbR
Vertreten durch: Daniel Lee, Nepomuk Reinhard und Nils Räder

Deutschhausstr. 10
35037 Marburg
Festnetz: +49 6421 379 6256
Mobil: +49 176 6127 7269
E-Mail: Lee at isi-solutions.org
Web: http://www.isi-solutions.org

ISIS wird gefördert durch die Bundesrepublik Deutschland, Zuwendungsgeber:
Bundesministerium für Wirtschaft und Technologie aufgrund eines Beschlusses
des Deutschen Bundestages, sowie durch die Europäische Union,
Zuwendungsgeber: Europäischer Sozialfonds.
Zusätzliche Unterstützung erhält ISIS von dem Entrepreneurship Cluster
Mittelhessen, der Universität Marburg, dem Laboratory for Climatology and
Remote Sensing und dem GIS-Lab Marburg.




Am 20. März 2012 23:08 schrieb Rich Shepard <rshepard at appl-ecosys.com>:

>  I want to transfer vector map attribute data from the default dbf to a
> postgres table. Reading the db.out.ogr manual page suggests that it will
> output the attribute table from the existing dbf to a postgres table, but
> the example does not appear to match the command syntax, and I don't get
> the
> difference between the input table name and the DSN name.
>
>  The command is:
> db.out.ogr input=name dsn=name format=string [db_table=name] [--verbose]
> [--quiet]
>
>  Looking at the example I see:
>
> db.out.ogr precip_30ynormals dsn="PG:host=localhost dbname=meteo
> user=neteler" format=PostgreSQL
> echo "SELECT * FROM precip_30ynormals" | psql meteo
>
>  If I want to move the attributes of the 'stream' table would the command
> be:
>
> db.out.ogr in=stream dsn="PG:host=localhost dbname=washington" \
> format=PostgreSQL
>
> echo "SELECT * FROM streams" | psql washington
>
> Rich
>
>
> ______________________________**_________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/grass-user<http://lists.osgeo.org/mailman/listinfo/grass-user>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20120321/42204c1a/attachment.html


More information about the grass-user mailing list