<div dir="auto">This resource is useful to help you get started exploring raster data with Python:<div dir="auto"><br></div><div dir="auto"><a href="https://carpentries-incubator.github.io/geospatial-python/05-raster-structure/index.html" rel="noreferrer noreferrer noreferrer" target="_blank">https://carpentries-incubator.github.io/geospatial-python/05-raster-structure/index.html</a></div><div dir="auto"><br></div><div dir="auto"><a href="https://www.earthdatascience.org/courses/use-data-open-source-python/intro-raster-data-python/raster-data-processing/" rel="noreferrer noreferrer" target="_blank">https://www.earthdatascience.org/courses/use-data-open-source-python/intro-raster-data-python/raster-data-processing/</a></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">If the CRS of your raster is not in meters, you will need to reproject your raster. I recommend changing the grid cell size in the same operation and using Resampling.max. Here are some helpful references:</div><div dir="auto"><br></div><div dir="auto"><a href="https://rasterio.readthedocs.io/en/latest/topics/virtual-warping.html" target="_blank" rel="noreferrer">https://rasterio.readthedocs.io/en/latest/topics/virtual-warping.html</a></div><div dir="auto"><br></div><div dir="auto"><a href="https://corteva.github.io/rioxarray/stable/examples/reproject.html#Reproject-Large-Rasters-with-Virtual-Warping">https://corteva.github.io/rioxarray/stable/examples/reproject.html#Reproject-Large-Rasters-with-Virtual-Warping</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 28, 2021, 12:56 AM Luca Bertoncello <<a href="mailto:lucabert@lucabert.de" rel="noreferrer noreferrer noreferrer" target="_blank">lucabert@lucabert.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am 28.12.2021 um 04:54 schrieb Alan Snow:<br>
<br>
Hi Alan<br>
<br>
> After some thought, you may achieve what you want by resampling the file<br>
> to a 5km grid size with the Resampling.max option:<br>
<br>
This is a good idea... I will need to write some code in Python (I don't<br>
really know this language), but I think I'll get it...<br>
<br>
> You can then store the centroid of the grid cell and the value in a<br>
> database.<br>
<br>
Yes, I already see with gdalinfo -mm (maybe there is a possibility to<br>
check it with Python?) I can get the maximum elevation and the centroid.<br>
<br>
Just some question, to correctly understand the code sample:<br>
<br>
1) I think, dataset.read get the size as parameter, correct? Are there<br>
meter/kilometer/something other?<br>
I searched some information about DatasetReader.read but I didn't found<br>
anything...<br>
2) In the example the new image will not be saved, is it correct? How<br>
can I do that? I didn't found any function DatasetReader.save...<br>
3) Maybe is it possible to do that in BASH? As I sayd, I'm not really<br>
fit in Python... :(<br>
<br>
Thanks a lot<br>
Luca Bertoncello<br>
(<a href="mailto:lucabert@lucabert.de" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">lucabert@lucabert.de</a>)<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>