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.

On Mon, Dec 27, 2021, 12:58 PM Luca Bertoncello <[email protected]>
wrote:

> Hi list!
>
> I'm very new to GDAL, so please excuse me if the question is too simple...
>
> My problem: I'm writing an App to fly VFR and I'd like to display a
> vertical profile of the route.
> Of course, it must work offline, so I cannot use a service like Google
> Maps or similar...
>
> I tryed OpenTopoData with the EUDEM dataset and I can get the elevation
> from a single point.
> Very nice, but not useful for my App...
>
> Since I don't need a huge precision, but I do need a relative small file
> to use in my App, it may suffice if I can create a database with the
> maximum elevation in a square 5x5 km, identified by the coordinates of
> the center.
>
> And here start the problems, since I don't have any idea how to extract
> these data from the TIFF files I have.
>
> On the server (Debian 10) is Python and PERL installed, as well as the
> GDAL utilities.
>
> Can someone help me?
>
> Thank you very very much for your help!
> 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

Reply via email to