Back in March, I attended the webinar Use of Copernicus Digital Elevation Model (DEM) in Flight Procedure Design, organized by EUSPA. Unfortunately, it seems that the webinar recording is not available. Please let me know if you manage to find it somewhere.
After the webinar, I decided to experiment a bit with the Copernicus Digital Elevation Model (DEM). The API is well documented, and you can find it here:
 |
Copernicus DEM GLO-30 Technical Characteristics, presentation slide |
When it comes to playing with the data from Copernicus Earth Observation Programme, I usually start by using the Copernicus Browser and then switch to the Copernicus Request Builder. Once I am satisfied with the request, as the next step, I run it from the command line. Here is the request that fetches the elevation data for my hometown's peninsula (you'll need your own bearer token):
curl -X POST https://sh.dataspace.copernicus.eu/api/v1/process \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-d '{
"input": {
"bounds": {
"bbox": [16.381985, 43.497764, 16.441381, 43.520298],
"crs": "http://www.opengis.net/def/crs/EPSG/0/4326"
},
"data": [
{
"type": "dem",
"dataFilter": {
"demInstance": "COPERNICUS_30"
}
}
]
},
"output": {
"resx": 0.000277777777777778,
"resy": 0.000277777777777778,
"responses": [
{
"identifier": "default",
"format": {
"type": "image/tiff"
}
}
]
},
"evalscript": "//VERSION=3\n\nfunction setup() {\n return {\n input: [\"DEM\"],\n output: {\n id: \"default\",\n bands: 1,\n sampleType: \"FLOAT32\"\n }\n }\n}\n\nfunction evaluatePixel(sample) {\n return [sample.DEM]\n}"
}'
You can execute the request by running:
sh request.sh > output.tif
The result is GeoTIFF file with elevation data, which in my case looks like as the following image:
 |
Resulting tif image |
To extract elevation points with Python, you will need the rasterio and numpy libraries. Here is the complete code of a script that converts pixels to (longitude, latitude, elevation) points, prints them out, along with the maximum elevation found:
import rasterio
import numpy as np
try:
with rasterio.open("output.tif") as src:
elev_data = src.read(1)
transform = src.transform
width, height = src.width, src.height
min_lon, min_lat = 16.381985, 43.497764
max_lon, max_lat = 16.441381, 43.520298
lon_step = (max_lon - min_lon) / width
lat_step = (max_lat - min_lat) / height
points = []
step = 1
for row in range(0, height, step):
for col in range(0, width, step):
lon = min_lon + col * lon_step
lat = max_lat - row * lat_step
elevation = elev_data[row, col]
if elevation != -9999:
points.append((lon, lat, elevation))
print("Elevation points (lon, lat, elevation):")
for point in points:
if point[2] != 0:
print(point)
max_elevation = max(point[2] for point in points)
print("\nMax elevation:", max_elevation)
except rasterio.errors.RasterioIOError:
print("Error: Could not open output.tif")
As I progressed, I thought, why not create an elevation API service to provide an alternative to the Google Elevation API? Fortunately, I decided to conduct some market research first. In addition to Google, I discovered around 10 other alternatives. Here’s a list of elevation API providers, presented in no particular order:
Google maps elevation API
JawgMaps
At the moment, the only elevation API provider listed is under European alternatives.
DemAPI
This one covers Netherlands only.
Open-Elevation
It offers both an API and a self-hosted solution. I believe it has a 250m resolution, and it mentions "higher resolution" for the professional tier. It appears that the project is abandoned, but there is a maintained fork. While checking the issue tracker, I discovered a source of LiDAR elevation data for Europe.
Open-meteo elevation API
Another API plus self-hosted solution. It has 90m resolution as it uses GLO-90 datasets.
Open topo data
API and self-hosted solution, this time with 30m resolution.
GPXZ Elevation API
Commercial sister of Open Topo Data. Parts of Europe and the US are covered with 1m LiDAR resolution, while GLO-30 is used for the rest of the globe. It can be hosted on EU-only servers if needed.
DEM.Net Elevation API
30m resolution, check it out for interesting 3D visualizations.
TessaDEM Elevation API
30m resolution
Maptoolkit Elevation API
Germany and Austria based, servers are in EU. They are listed on RapidAPI marketplace, that was recently acquired by Nokia.
Bing Maps Elevations API
Apparently, it was not a commercial success for Microsoft, as they are retiring it. The free plan will shut down on June 30, 2025, and the enterprise plan one year after that. However, they have included a link to the step-by-step article on how to Create elevation data & services on Azure Cloud (30m resolution).
I'll conclude this post with a few more things:
The domain elevation.eu is taken and is being sold for €2,000 + VAT.
The contacts for the EGNOS service adoption team are:
egnos-adoption@essp-sas.eu / +34 91 627 88 63 / +34 91 627 88 59.