4

Originalfields before truncating to lat,lon,dateI have previously used Temporal for animations with no problem but when I tried a new animation today with "Single field with date/time" the input below didn't show down arrow to select field, double L & R clicking made no difference.Grab of dialogue box. A previously working animation has stopped working and shows same behaviour when temporal is selected.

The file in question had different columns for date and time. So I modified file to first have date only column and second a merged date/time column. Exactly the same result ie field selection arrow had no effect. restarting QGIS between each attempt. I suspect that QGIS temporal has become corrupted and will need to reload QGIS.

Unfortunately that is not the answer I removed/reinstalled QGIS but the original Temporal problem remains. Any ideas? The only way that this problem could arise is that Temporal was modified on the lines of if field type not Date then ignore which would explain why a previously working animation failed.

I have tried the field calculator but the "Update field" is greyed out. enter image description here The only data required for an animation is lat, lon & date (or date/time) the other fields are not required. So the solution is to use simple csv file in conjunction with csvt file.

13
  • 3
    Which version of qgis? Which platform: win10?
    – Babel
    Commented Nov 24, 2020 at 19:10
  • On your screenshot, everything looks all right, down arrow to select field appears as it should. What exactly is the problem? Did you try to restart QGIS, maybe you machine as well? Does the problem persist?
    – Babel
    Commented Nov 24, 2020 at 20:00
  • 1
    If there are no fields formatted as date/datetime, you can't select any fields and the down arrow will do nothing as you don't have anything to select
    – Babel
    Commented Nov 24, 2020 at 20:04
  • The problem is nothing changes when the down arrow is clicked. I have tried restarting QGIS and machine many times. There is a date/time field in the file in question. As I stated before when a previously working animation is loaded it shows the same problem.
    – Vic
    Commented Nov 25, 2020 at 9:01
  • QGIS is Hanover 3.16.1 on Ububtu 20.04. The same QGIS version is working fine on Win 10 Surface Book.
    – Vic
    Commented Nov 25, 2020 at 9:07

1 Answer 1

2

The problem is that QGIS does not recognize dates if they are stored in a field formatted as string. In this case, QGIS temporal is not able to recognize a date-type data field and thus, you can't select anything. That explains the behaviour in your case what is just as expected in this case. It seems your date was converted to a string fieldtype when you imported it. See Anita Graser's blog for a solution: https://anitagraser.com/2011/03/07/how-to-specify-data-types-of-csv-columns-for-use-in-qgis/

But you don't have to re-import everything. You can convert the existing date field by creating a new field using field calculator and converting the string to date type. Use to_date or to_datetime expressions. For more detailed advise, plese include a sample (even if screenshot) of your date field.


Update: load data

I uploaded three files so that you cant test if everything works as it does on my machine: data.csv - the sample data you provided as delimited text. data.gpkg - the same converted to a Geopackage. temporal_test.qgz - a test project with both of these files as layers and activated temporal setting for the csv layer. You find the data here: https://drive.switch.ch/index.php/s/EE58pZKVfGKm8Ei

So please try of all the following steps work for you:

I copied the first 4 rows of the data you provided in your screenshot in an exel sheet and saved it as csv utf-8 coded. I imported that file to QGIS 3.16.0 on Win 10; Data Source Manager / Add Delimited Text Layer and activated Detect field types - see screenshot:

enter image description here

Than I accessed Layer Properties / Tab Temporal. There, I could easily select the Date field that contains the timestamp. I did not encounter the problem you describe:

enter image description here

The Date field of the imported csv points layer is clearly recognized as being of date type without any manual changes:

enter image description here

7
  • The only way I could get this to work was by reducing the file to 3 fields, lat,lon and date with the csvt file = "Real","Real","Date" both files have to be the only files in their folder, if they are with other files QGIS ignores the csvt file. I still don't understand why a file that previously worked perfectly in QGIS Temporal suddenly stopped working.
    – Vic
    Commented Nov 26, 2020 at 17:56
  • Did you try to convert the field with the field calculator? If you could add at least one row of your original data (be it as screenshot) to your question, it would be easier to know what we discuss about. It's quite difficult to guess "in the dark" without seeing your data what's going on. Maybe something went wrong when you imported your data as csv - be very carfeful about separator characters. If they are not set accordingly, your data might get messed up.
    – Babel
    Commented Nov 26, 2020 at 18:32
  • By the way: if you copy a few cells of your csv in exel, you can paste it to your question as well, dont need to make screenshot
    – Babel
    Commented Nov 26, 2020 at 18:34
  • It does work correctly with the files you provided. I did originally forget to convert date format from dd mm yyyy to yyyy mm dd when I first loaded the file. I then converted date but it still had the same problem. I think if I had restarted QGIS that might have saved a lot of frustration. Thank you for your patience.
    – Vic
    Commented Nov 27, 2020 at 23:19
  • You're welcome. Consider accepting this answer if it solved your problem
    – Babel
    Commented Nov 27, 2020 at 23:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.