3

I need to create a time series graph for a few random cells with known underlying attribute such as "forest" or "agriculture" based on the VCI (Vegetation Condition Index). I have been reading and looking into time series in QGIS but have not found anything that can do what I need it to do, as most only draw a time series movie of the area and usually only work with vector data, which I need neither of those 2 types of applications.

The time series is 16 years worth of data, based on 16 day NDVI composites which gives a total of about 368 Rasters. I then need to choose some random cells within areas that have known vegetation landuse classes such as a forest. Each cell selection should then have 368 total values (for each Raster). From these 368 values I would like to extrapolate them into a time series line graph format. Something similar to the below image: Time Series Graph Example

So in theory I should be able to make several graphs that would have 368 values on the X-axis representative of the changes through time of the VCI of those specific cells.

Ideally it would be good if the application can either draw this graph and save the values to a .txt or .csv file but also even if it can only save the values to a .csv I can then plot this time series easily in Excel.

4 Answers 4

5

There is a plugin tool in QGIS called Mutant.

  1. Load all Rasters into a layer.
  2. Choose a point. (Make sure that in the Options Tab in Mutant the "Plot values only when mouse is clicked" is checked.)
  3. In the Mutant plugin in the Table tab there should now be a long list of values, click 'Export to CSV'.
  4. Open in Excel and manipulate the data as desired into correct time series order.
  5. Create Line Graph with layer label (Time) as X axis with Values as Y Axis.
  6. Will then have a time series graph of VCI.
0

It might be easiest with a script rather than using tools. The script structure would look something like this:

  1. Open first file.
  2. Extract Date/Time information

  3. Load raster as data array

  4. Choose random point

  5. If random point has underlying attribute place in dictionary

  6. Place Date/Time and NDVI in a list within a list in dictionary

  7. Choose other random points and repeat steps 5 and 6

  8. Look up the same points in other rasters and add to the same dictionary

  9. write data from dictionary to a text file.

I don't have enough status to provide comments, otherwise I would have made comment instead. I could probably make a Python script for you if you find the above unworkable, and, if you could provide some example data.

1
  • I have instead gone with Mutant plugin tool in QGIS, I loaded all of the Rasters and then went to the table option to export all to CSV file format. In which I cleaned it up and reorganized in Excel. And created the time series manually with Excel's line graph tool.
    – Leif
    Commented Jun 29, 2016 at 13:07
0

TIMESAT software is good for generating NDVI timeseries curve. Also, you can apply various filtering techniques to smooth the curves caused by cloud cover.

1
  • Could you please provide a more in-depth description of your solution, so that others can follow your approach easily?
    – root676
    Commented Jul 11, 2019 at 10:56
0

Use the Temporal/Spectral Profile Tool plugin: https://plugins.qgis.org/plugins/temporalprofiletool/

It plots the values of a particular layer as a graph. So you may need to merge your layers into one first by using Raster -> Miscellaneous -> Build Virtual Raster (Catalog) (make sure to check "Separate").

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.