I have a database of climatic data for farms in postgresql/postgis. it contains information about temperature, humidity and ... for farms and it is updated every hour. I need to perform some (spatio-)temporal aggregation on it. the queries would be like "for every square kilometer of the country, compute the monthly precipitation". I was wondering if there are some functions to do that or I should write the desired algorithm for it.
Thank you