Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] db.in.ogr should recognize column data types when importing CSV files #4593

Open
cmbarton opened this issue Oct 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@cmbarton
Copy link
Contributor

cmbarton commented Oct 25, 2024

The problem
CSV is one of the most commonly and widely used formats for exchanging tabular data across platforms. However, it is difficult to import csv files into GRASS. Currently, db.in.ogr imports csv files but transforms all columns to text. The suggested work around is to create an accompanying *.csvt file that specifies the data types for each column. This is very cumbersome, especially for files with many columns. But OGR will automatically recognize column data types if a file open option is set
-oo AUTODETECT_TYPE=YES
This makes importing csv files much easier. This can be manually entered into the gdal_oo argument in db.in.ogr but this is not mentioned in the manual. It would be even better if this is the default behavior of db.in.ogr

Proposed solution
-oo AUTODETECT_TYPE=YES should be the default for importing a csv file using db.in.ogr
a "csvt" flag should be added to enable a user to create a csvt file to override this default behavior

See #4450 for additional information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant