Hi all,
I’ve been working on trying to generate a 3D mesh from DEMs pulled from Copernicus, which would ideally be as close to the real-world equivalent in terms of measurements as possible. The problem is that the elevation values seem to be all over the place in terms of the brightness value of the pixels in the returned image.
For example, I got this DEM of table mountain in South Africa using the following code:
async function getDEM(bbox, token) {
const response = fetch("https://services.sentinel-hub.com/api/v1/process",
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + token,
},
body: JSON.stringify({
"input": {
"bounds": {
"properties": {
"crs": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
},
"bbox": bbox
},
"data": :{
"type": "DEM"
}]
},
"output": {
"width": 1024,
"height": 1024,
"responses": :{
"identifier": "default",
"format": {
"type": "image/tiff"
}
}]
}
,
"evalscript": `
//VERSION = 3
function setup() {
return {
input: :"DEM"],
output: {bands: 1}
}
}
function evaluatePixel(sample) {
return nsample.DEM/1000]
}`
})
}
)
return response
}
This seems to cap out the height value, since the brightest pixels values are at 255, however, a quick google search shows that Table Mountain only reaches about a kilometer in elevation. This would mean that elevation can only be between sea level and at maximum 1 kilometer, despite the documentation stating that is should be able to range between -11000 to +9000 meters.
Anyway, sorry the long winded question but does anyone have any insight into why this might be, and also how to increase the range of altitudes that can be effectively used?
Thanks.