db.in.ogr(1)
π¦ db.in.ogr(1) β the GRASS GIS User's Manual page π¦
okay so bestie, this is the db.in.ogr(1) manual page, and it's lowkey one of the most useful little gremlins in the whole GRASS GIS toolbox. It's giving "let me drag literally any attribute table into your mapset". Buckle up, we're going through the WHOLE thing, no skipping, periodt. π
β¨ NAME β¨
db.in.ogr β imports attribute tables in various formats.
π KEYWORDS π
database, import, attribute table
πΈ SYNOPSIS πΈ
db.in.ogr
db.in.ogr --help
db.in.ogr input=name [gdal_config=string] [gdal_doo=string]
[db_table=name] [output=name] [key=string] [encoding=string]
[--overwrite] [--help] [--verbose] [--quiet] [--ui]
π Flags:
--overwriteβ lets output files overwrite files that already exist. yes she will bulldoze, be careful babe π--helpβ prints the usage summary, aka the "what do I even do here" button--verboseβ verbose module output, she will talk A LOT--quietβ quiet module output, she will not talk at all--uiβ forces the GUI dialog to launch, main character window energy π
π Parameters:
input=name[required] β the table file to be imported, OR a DB connection string. required required, no input no party.gdal_config=stringβ GDAL configuration options. it's a comma-separated list ofkey=valuepairs.gdal_doo=stringβ GDAL dataset open options. also a comma-separated list ofkey=valuepairs.db_table=nameβ name of the table from the given DB that you want importedoutput=nameβ the name for your output tablekey=stringβ name for an auto-generated unique key columnencoding=stringβ encoding value for attribute data
π DESCRIPTION π
db.in.ogr imports attribute tables in various formats as supported by the OGR library on the local system β think DBF, CSV, PostgreSQL, SQLite, MySQL, ODBC, etc. β¨ And optionally, a unique key (ID) column can be added to the table. that's it, that's the whole vibe.
π EXAMPLES π
π Import CSV file
Limited type recognition can be done for Integer, Real, String, Date, Time and DateTime columns through a descriptive file with same name as the CSV file, but .csvt extension (see details here).
# NOTE: create koeppen_gridcode.csvt first for automated type recognition
db.in.ogr input=koeppen_gridcode.csv output=koeppen_gridcode gdal_doo="AUTODETECT_TYPE=YES"
db.describe koeppen_gridcode -c
db.select table=koeppen_gridcode
π§ Import DBF table
Import of a DBF table with additional unique key column (e.g., needed for v.in.db).
db.in.ogr input=/path/to/mydata.dbf output=census_raleigh key=myid
db.describe -c census_raleigh
π¦ Import of a SQLite table
db.in.ogr input=/path/to/sqlite.db db_table=census_raleigh output=census_raleigh
π Import of a PostgreSQL table
# HINT: if the database contains spatial tables, but you want to import a non-spatial
table, set the environmental variable PG_LIST_ALL_TABLES to YES before importing
db.in.ogr input="PG:host=localhost dbname=ecad user=neteler" \
db_table=ecad_verona_tmean output=ecad_verona_tmean
db.select table=ecad_verona_tmean
db.describe -c ecad_verona_tmean
π Import XLS file
To force reading headers, define environmental variable OGR_XLS_HEADERS=βFORCEβ. Parameter db_table refers to the list within XLS file.
export OGR_XLS_HEADERS=βFORCEβ
db.in.ogr input=address.xls db_table=address_data
π«Ά SEE ALSO π«Ά
db.select, v.in.ogr, v.in.db
GRASS SQL interface
β AUTHOR β
Markus Neteler
π SOURCE CODE π
Available at: db.in.ogr source code (history)
Accessed: Saturday Jan 17 05:41:51 2026
Main index | Database index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
and that's a wrap bestie π this whole page lives in GRASS 8.4.2 (db.in.ogr(1), obvi), the source code was accessed Saturday Jan 17 05:41:51 2026, and the copyright belongs to the GRASS Development Team, Β© 2003-2025, from the GRASS GIS 8.4.2 Reference Manual. go import something cute, ily, bye πβ¨
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms