db.out.ogr.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <h2>DESCRIPTION</h2>
  2. <em>db.out.ogr</em> exports GRASS GIS attribute tables into various formats as
  3. supported by the OGR driver on the local system (CSV, DBF,
  4. PostgreSQL, SQLite, MySQL, ODBC, etc.).
  5. <p>
  6. The <em>dsn</em> parameter is commonly the output file name (if the path is not
  7. defined, too, the module will attempt write to the current directory). In case
  8. of a database connection as output, the connection string has to be specified.
  9. <p>
  10. The <em>layer</em> parameter is needed if the attribute table to be exported
  11. is linked as non-default layer to a vector map.
  12. <h2>EXAMPLES</h2>
  13. Export of GRASS table to a DBF table (default format):
  14. <p><div class="code"><pre>
  15. db.out.ogr precip_30ynormals dsn=/tmp/precip_30ynormals.dbf
  16. </pre></div>
  17. <p>Export of GRASS table to a CSV table file:<br>
  18. <p><div class="code"><pre>
  19. db.out.ogr precip_30ynormals dsn=precip_30ynormals.csv format=CSV
  20. </pre></div>
  21. <p>Export of GRASS table into a PostgreSQL table:
  22. <p><div class="code"><pre>
  23. db.out.ogr precip_30ynormals dsn="PG:host=localhost dbname=meteo user=neteler" \
  24. format=PostgreSQL
  25. echo "SELECT * FROM precip_30ynormals" | psql meteo
  26. </pre></div>
  27. <h2>SEE ALSO</h2>
  28. <em><a href="sql.html">GRASS SQL interface</a></em>
  29. <h2>AUTHOR</h2>
  30. Markus Neteler
  31. <p><i>Last changed: $Date$</i>