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

Add support for OGR data type Date in shapefiles #178

Open
Dave-Allured opened this issue Nov 17, 2021 · 0 comments
Open

Add support for OGR data type Date in shapefiles #178

Dave-Allured opened this issue Nov 17, 2021 · 0 comments

Comments

@Dave-Allured
Copy link
Contributor

Some shapefiles are now (2021) being generated with OGR data type Date. NCL versions up through 6.6.2 are not able to read this data type. See this recent request from an NCL user, and discussion.
https://mailman.ucar.edu/pipermail/ncl-talk/2021-November/018532.html

Symptoms

  • With ncl_filedump: Data type "none" is printed for Date variables.

  • With addfile: Error is printed:

fatal:Variable <var name> in file <file name> does not have a recognized type: cannot get value

Requested solution
Add support for reading OGR data type Date, through addfile and the normal built-in NCL shapefile driver. On input, convert values of OGR type Date to NCL type string in the format YYYY/MM/DD.

Alternatives
A workaround is to read this data type indirectly with systemfunc and the ogrinfo utility program, as described in the above ncl-talk message. This is inferior because it is complicated and has a risk of reading Date variables in a different array order than data read normally through addfile.

Reference
Description of GDAL shapefile driver:
https://gdal.org/drivers/vector/shapefile.html

Under "Creation Issues", note the comment about supported and unsupported OGR data types. NCL uses GDAL to read shapefiles. Therefore, any data type unsupported in GDAL must also be unsupported in NCL.

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

No branches or pull requests

1 participant