I have time series raster data in PostGIS and I can't find a way to get the info as a time series from an XY point.

For example:

I would like to get the vale of the XY point in raster for the 13/08/2015 - 20/08/2015

I have one raster for each day in the year 2015, each raster has values of some data from remote sensing satellite and I want to see how the value is changing week on week.


and so on.

  • what you want to do with the value? Calculate the mean for a week or something? Not entrirely sure if i understand it correctly. – Matte Aug 13 '16 at 12:22

When you want to summarize a value for a given time slot you can use the date_trunc function to group your data. For example:

date_trunc('week', your_date_column),
min (X),
min (Y),
from your_table
group by date_trunc('week', your_date_column)

The min (X) is needed for the aggregation as otherwise the program does not know how to handle the 7 values. As they are identical you can acutally use any aggregate function here.

  • hi thank you for the answer, is thare a way to get the vale for each day in the week so i can plot a time series(no Calculate for the vale just get the vale for for each day of the week) – YARON Aug 13 '16 at 15:18

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.