db.out.ogr(1)

πŸ’– db.out.ogr πŸ’–

okay bestie, welcome to the GRASS GIS User's Manual page for db.out.ogr β€” she's a lil icon in the GRASS GIS fam and she's about to make your attribute tables travel. 🧳✨


✨ NAME ✨

db.out.ogr β€” exports attribute tables into various formats. no cap, that's literally her whole thing. πŸ’…


πŸ”‘ KEYWORDS πŸ”‘

database, export, output, attribute table πŸŽ€


πŸ“œ SYNOPSIS πŸ“œ

db.out.ogr
db.out.ogr --help
db.out.ogr input=name output=name  [layer=string]  format=string
[table=name]   [--overwrite]  [--help]  [--verbose]  [--quiet]  [--ui]

🚩 Flags:

  • --overwrite β€” lets your output files just bulldoze over existing files. allow it. 😌
  • --help β€” prints the usage summary, i.e. the "what do I even do here" button 🫢
  • --verbose β€” verbose module output, she talks more, she's chatty ✨
  • --quiet β€” quiet module output, she whispers, she's mysterious 🀫
  • --ui β€” forces the GUI dialog to launch. pop-up era. πŸͺŸ

πŸŽ›οΈ Parameters:

  • input=name [required] β€” GRASS table name. or, plot twist, a data source for direct OGR access. πŸ¦‹
  • output=name [required] β€” output table file name, or a DB connection string. πŸ‘‘
  • layer=string β€” layer number or name. vector features can have category values in different layers, and this number picks which layer to use. when you're doing direct OGR access, this is the layer name instead. Default: 1 πŸ’œ
  • format=string [required] β€” table format. Options: CSV, DBF, GML, MySQL, PostgreSQL, SQLite. Default: CSV 🌈
  • table=name β€” name for output table (default: input name). it's giving "same name, new zip code". 🏠

🌸 DESCRIPTION 🌸

db.out.ogr exports GRASS GIS attribute tables into a whole menu of formats, whatever the OGR driver on your local system supports β€” CSV, DBF, PostgreSQL, SQLite, MySQL, ODBC, etc. so many options, so many vibes. πŸ˜­πŸ’–

the output parameter is what defines the output file name. if the path isn't defined, the module will attempt to write to the current directory β€” so yeah, she'll just drop it right there, lowkey bold of her. and if you're outputting to a database connection, you have to specify the connection string. no string, no table, periodt. πŸ”₯

the layer parameter is needed if the attribute table you're exporting is linked as a non-default layer to a vector map. so if your table's in its non-default era, say it with layer. πŸ’…


🌟 EXAMPLES 🌟

Export of GRASS GIS attribute table to a CSV table file (default format)

db.out.ogr input=precip_30ynormals output=precip_30ynormals.csv

Export of a GRASS GIS attribute table to a DBF table

db.out.ogr input=precip_30ynormals output=precip_30ynormals.dbf format=DBF

Export of a GRASS GIS attribute table into a PostgreSQL table

db.out.ogr input=precip_30ynormals \
           output="PG:host=localhost dbname=meteo user=neteler" \
           format=PostgreSQL
# verify
echo "SELECT * FROM precip_30ynormals" | psql meteo

look at that verify step, she's thorough, she checks her work. main character energy fr fr. πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

  • db.tables
  • GRASS SQL interface

🫢 AUTHORS 🫢

  • Markus Neteler
  • Converted to Python by Glynn Clements

legends, honestly. we stan. πŸ’œ


πŸ’» SOURCE CODE πŸ’»

Available at: db.out.ogr source code (history)

Accessed: Saturday Jan 17 05:41:51 2026

Main index | Database index | Topics index | Keywords index | Graphical index | Full index


and that's the whole page, bestie!! πŸŒˆπŸ’– go export something gorgeous. mwah. πŸŽ€

okay so final sign-off: this was the GRASS GIS 8.4.2 Reference Manual, Β© 2003-2025 GRASS Development Team β€” and this very page was db.out.ogr(1), printed by GRASS 8.4.2. slay, bye!! βœ¨πŸ¦‹πŸ’…

πŸ“¦ where this page comes from