2

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.

3

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.

  • 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 Jun 29 '16 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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