I have a dataset with couple million farm polygons (around 2.5 million and only expected to grow in the future), and I need to calculate the NDVI for these farm polygons, with some basic stats (Average, Min, Max), and store the results in a PostGIS table as a simplified JSON (rounding off the NDVI values to the nearest 0.05).
Currently I am using a combination of rasterio and gdal in python to clip these polygons with respect to preprocessed NDVI images, but the process is very slow. On average, I am getting 4 new NDVI images each month, the process is slow enough that I have not been able to clear a backlog to calculate historical NDVI values.
I have implemented Multi-Processing in Python to limited success. The current stack I'm working with has python, gdal and postgis setup, but I am willing to consider other frameworks or languages if the performance boost is significant enough.