Finding max elevation of a DEM tile
There are several sources of Digital Elevation Model (DEM) tiles, sometimes called “terrain tiles” online. Instead of containing cartographic features such as roads, rivers and cities, each pixel of a DEM tile encodes the elevation found in the corresponding location. Recently, I became interested in finding the maximum elevation for each one of these tiles in order to accelerate shadow calculation on shademap.app
DEM tile for zoom level 0
At zoom level 0, the entire world map is encoded on just one tile. I would expect the max elevation of any pixel of this tile to equal the height of Mount Everest (8848m), since this is the highest point on earth. In reality, I found that the maximum value was actually (5887m). My theory is that there is some averaging or interpolation that is done when reducing the data to a single 256x256 pixel tile. Each pixel of a tile at zoom level 0...