-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
ogr2ogr: translate of DateTime column to shapefile gives an error #11671
Comments
Is it correct by the GeoPackage standard to write date without time "2014-12-04" into a DATETIME field? Shouldn't it be in a DATE field? |
True... probably not... even though it might be useful that it would stay working anyway. I replaced the value with "2020-05-01T00:00:00.000Z" in the script above, which gives the same error. EDIT: for further testing purposes, I replaced the value as well by "2020-05-01T01:02:03.456Z", and when arrow is disabled, that DateTime is also saved as Date in shapefile, so also if there is useful time information (rather than all 0's), it also seems to be dropped in the "old" code path... |
I think that DATETIME should be written as text into shapefile always because native data type is not supported. And DATE should go through as DATE because it is supported. |
…ng, both in Arrow and non-Arrow code paths Fixes OSGeo#11671
Add CI config to test on the gdal "nightly" master version. GDAL will be installed from the gdal-master conda channel: https://anaconda.org/gdal-master/libgdal-core/files Activating gdal nightly CI triggered this: - [x] OSGeo/gdal#11671
What is the bug?
On the master branch, when a GPKG with a datetime column is converted to a shapefile, an error is thrown:
When OGR2OGR_USE_ARROW_API is set to NO, the error doesn't occur.
Remark: I don't have a strong opinion about this being good or bad... (probably I think the arrow behaviour is even an improvement), but there is also a difference in the result being written for GDAL versions < 3.11 between when arrow is used or not:
String
type columnDate
type column, with the disadvantage that all time information is lostSteps to reproduce the issue
Script can be ran to show two things:
String
column for the inputDateTime
columnDate
column for the inputDate
columnDate
column for both the inputDateTime
andDate
columnVersions and provenance
Tested on windows 11, with gdal installed using conda.
Additional context
No response
The text was updated successfully, but these errors were encountered: