Have a look at: https://www.gdal.org/gdallocationinfo.html This page gives examples how to script it for a polygon: https://gis.stackexchange.com/questions/317213/gdal-gdallocationinfo-of-cgiar-mosaic-elevation-data Have fun /Lars Schylberg