After some thought, you may achieve what you want by resampling the file to a 5km grid size with the Resampling.max option:
https://rasterio.readthedocs.io/en/latest/topics/resampling.html https://rasterio.readthedocs.io/en/latest/api/rasterio.enums.html#rasterio.enums.Resampling.max You can then store the centroid of the grid cell and the value in a database. On Mon, Dec 27, 2021, 1:45 PM Luca Bertoncello <[email protected]> wrote: > Am 27.12.2021 um 20:20 schrieb Alan Snow: > > Hi Alan, > > thank you very much for your answer! > > > You may be looking for clip/mask: > > > > > https://rasterio.readthedocs.io/en/latest/topics/masking-by-shapefile.html > > > > https://corteva.github.io/rioxarray/stable/examples/clip_geom.html > > > > After clipping, you can use numpy to do the sum. > > As I sayd, I'm really new to GDAL. > I just have these TIFF-files and can't unterstand, from the pages you > linked, how can I split alle these files in little tiles of a given size. > Maybe can you give me an example? > > Thanks a lot > Luca Bertoncello > ([email protected]) > _______________________________________________ > gdal-dev mailing list > [email protected] > https://lists.osgeo.org/mailman/listinfo/gdal-dev >
_______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
