[Qgis-developer] working with temporal data

Martin Dobias wonder.sk at gmail.com
Sat Aug 7 11:43:21 EDT 2010


2010/8/7 Václav Řehák <rehakv01 at gmail.com>:
> Dne 4. srpna 2010 22:10 Giovanni Manghi <giovanni.manghi at gmail.com> napsal(a):
>> Hi,
>>
>>>  Talking about
>>> temporal data, is there any reason why there is no support for
>>> datetime attributes in QGIS, only numbers and strings? In our study we
>>> need to create point features for locations where an animal was
>>> observed and the filter those features based on date and time.
>> I believe it does not depend on the program but on the datasource. If
>> you are using shapefiles you are limited to numer and strings. Take a
>> far more advanced database like postgis and you'll have plenty of
>> datatypes, including date/time.
>
> There is a forum post (http://forum.qgis.org/viewtopic.php?f=2&t=6732)
> claiming that shapefile attributes being just a DBF records might be
> usable for datetime. So I wonder if this is a limitation of QGIS or
> the shapefile format (or a specific version of the format).

According to this page [1], shapefile supports date and datetime field
type. QGIS currently doesn't support date, time and datetime
attributes. From a brief look at OGR shapefile driver, it supports
'date' fields, but not 'datetime' fields.


> Sure, I can use postgis and write SQL filters to filter by time but I
> need a user-friendly way of creating new layers (either shapefile,
> SQLite or PostGIS; just any format) with datetime attributes from
> QGIS, either manually or from a plugin. The only workaround I found is
> to tell my users to create the layers with attributes as text and then
> convert it for them to Postgres datetime so they can filter using the
> time. But this is barely acceptable for regular usage.

You could also use timestamps instead of regular datetime format.
Together with custom edit forms in QGIS I think it's possible to use
date time widget and convert the values from/to timestamps.

[1] http://www.dbf2002.com/dbf-file-format.html

Regards
Martin


More information about the Qgis-developer mailing list