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

OpenGDB with timestamps (DataTime) are sometime off by one second. #57797

Closed
2 tasks done
JeromeLefebvre opened this issue Jun 18, 2024 · 2 comments
Closed
2 tasks done
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers Feedback Waiting on the submitter for answers macOS

Comments

@JeromeLefebvre
Copy link

What is the bug or the crash?

I have a .gdb file that contains hourly values, when I see the values in GQIS, the timestamp is sometimes off by one second.

Here is what I will see in QGIS:

-- select * from bug
OBJECTID	time	SHAPE
1	2000-01-01T00:59:59.000Z	Point (0 0)
2	2000-01-01T02:00:00.000Z	Point (0 0)
3	2000-01-01T03:00:00.000Z	Point (0 0)
4	2000-01-01T03:59:59.000Z	Point (0 0)
5	2000-01-01T05:00:00.000Z	Point (0 0)

But, all the timestamps should be at the hour exactly.
I can confirm this using ogrinfo and that the time column is using the correct data type DataTime.

>> ogrinfo Maps/bug.gdb bug
INFO: Open of `Maps/bug.gdb'
      using driver `OpenFileGDB' successful.

Layer name: Bug
Geometry: Point
Feature Count: 23
Extent: (0.000000, 0.000000) - (0.000000, 0.000000)
Layer SRS WKT:
GEOGCRS[...]
Data axis to CRS axis mapping: 2,1
FID Column = OBJECTID
Geometry Column = SHAPE
time: DateTime
OGRFeature(Bug):1
  time (DateTime) = 2000/01/01 01:00:00+00
  POINT (0.0 0.0)

OGRFeature(Bug):2
  time (DateTime) = 2000/01/01 02:00:00+00
  POINT (0.0 0.0)

OGRFeature(Bug):3
  time (DateTime) = 2000/01/01 03:00:00+00
  POINT (0.0 0.0)

OGRFeature(Bug):4
  time (DateTime) = 2000/01/01 04:00:00+00
  POINT (0.0 0.0)

OGRFeature(Bug):5
  time (DateTime) = 2000/01/01 05:00:00+00
  POINT (0.0 0.0)

This also then impacts the temporal analysis as sometime nothing will be shown for a filter like 1:00 ≤ t < 2:00

Steps to reproduce the issue

  1. Right click on the provided "bug.gdb" and select execute SQL
  2. Execute select * from bug and you will see that the time stamps are not at every hour.
    image
    QGIS-BugReport.zip

Versions

QGIS version
3.36.3-Maidenhead
QGIS code revision
2df9655469b
Qt version
5.15.2
Python version
3.9.5
GDAL/OGR version
3.3.2
PROJ version
8.1.1
EPSG Registry database version
v10.028 (2021-07-07)
GEOS version
3.9.1-CAPI-1.14.2
SQLite version
3.35.2
PDAL version
2.3.0
PostgreSQL client version
unknown
SpatiaLite version
5.0.1
QWT version
6.1.6
QScintilla2 version
2.11.5
OS version
macOS 14.5

Active Python plugins
changeDataSource
3.1
quick_map_services
0.19.34
qduckdb
0.7.3
processing
2.12.99
grassprovider
2.12.99
db_manager
0.1.20
MetaSearch
0.3.6

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@JeromeLefebvre JeromeLefebvre added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jun 18, 2024
@agiudiceandrea agiudiceandrea added the Data Provider Related to specific vector, raster or mesh data providers label Jun 19, 2024
@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jun 19, 2024

@JeromeLefebvre, thanks for reporting. Please specify the detailed steps in order to replicate the issue.
The issue doesn't occur using QGIS 3.36.3 (OSGeo4W) on my Windows 10 system: the timestamps are correctly displayed either in the attribute table,

image

or in the DB Manager

image

or in the Browser

image

image

Have you actually tried using a new QGIS user profile? Anyway the issue may be due to the old version of the GDAL/OGR library used by QGIS in your system.
Please try if the issue occurs also using a QGIS build with a newer GDAL/OGR library version like the one provided by MacPorts https://www.qgis.org/en/site/forusers/alldownloads.html#macports

@agiudiceandrea agiudiceandrea added Feedback Waiting on the submitter for answers macOS labels Jun 19, 2024
@JeromeLefebvre
Copy link
Author

You are correct.
GDAL 3.3.2 is what comes with the homebrew version of QGIS.
The Macport version of QGIS comes with 3.9; the problem does not occur with this version.

Thank you for looking into this!
The following issue more accurately represents the issue faced when using homebrew to install QGIS on a Mac.
qgis/QGIS-Mac-Packager#153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers Feedback Waiting on the submitter for answers macOS
Projects
None yet
Development

No branches or pull requests

2 participants