You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/datasets/eudem.md
+8-114
Original file line number
Diff line number
Diff line change
@@ -30,45 +30,25 @@ The advantage of the `NODATA` oceans is that you cane use EU-DEM without clippin
30
30
31
31
## Adding EU-DEM to Open Topo Data
32
32
33
+
As of Jan 2024, EU-DEM is no longer available to download via copernicus.eu.
33
34
34
-
Make a new folder for the dataset:
35
+
I have uploaded my version of the dataset at [https://files.gpxz.io/eudem_buffered.zip](https://files.gpxz.io/eudem_buffered.zip), see [EUDEM download](https://www.gpxz.io/blog/eudem) for more details.
35
36
36
-
```bash
37
-
mkdir ./data/eudem
38
-
```
39
-
40
-
Download the dataset from [Copernicus](https://land.copernicus.eu/imagery-in-situ/eu-dem/eu-dem-v1.1?tab=download). There are 27 files. Unzip them and move all the `.TIF` files into the data folder (you don't need the `.aux.xml`, `.ovr`, or `.TFw` files).
41
-
42
-
Your data folder should now contain only 27 TIF files:
37
+
Download and unzip the folder into:
43
38
44
39
```bash
45
-
ls ./data/eudem
46
-
47
-
# eu_dem_v11_E00N20.TIF
48
-
# eu_dem_v11_E10N00.TIF
49
-
# eu_dem_v11_E10N10.TIF
50
-
# ...
51
-
```
52
-
53
-
54
-
If you have [gdal](https://gdal.org) installed, the easiest thing to do here is build a [VRT](https://gdal.org/drivers/raster/vrt.html) - a single raster file that links to the 27 tiles and which Open Topo Data can treat as a single-file dataset.
The `tr`, `tap`, and `te` options in the above command ensure that slices from the VRT will use the exact values and grid of the source rasters.
64
-
42
+
There are 27 files.
65
43
66
44
Then create a `config.yaml` file:
67
45
68
46
```yaml
69
47
datasets:
70
48
- name: eudem25m
71
-
path: data/eudem-vrt/
49
+
path: data/eudem
50
+
filename_epsg: 3035
51
+
filename_tile_size: 1000000
72
52
```
73
53
74
54
Finally, rebuild to enable the new dataset at [localhost:5000/v1/eudem25m?locations=51.575,-3.220](http://localhost:5000/v1/eudem25m?locations=51.575,-3.220).
@@ -82,92 +62,6 @@ make build && make run
82
62
If you don't have gdal installed, you can use the tiles directly. There are instructions for this [here](https://github.com/ajnisbet/opentopodata/blob/f012ec136bebcd97e1dc05645e91a6d2487127dc/docs/datasets/eudem.md#adding-eu-dem-to-open-topo-data), but because the EU-DEM tiles don't come with an overlap you will get a `null` elevation at locations within 0.5 pixels of tile edges.
83
63
84
64
85
-
### Buffering tiles (optional)
86
-
87
-
The tiles provided by EU-DEM don't overlap and cover slightly less than a 1000km square. This means you'll get a `null` result for coordinates along the tile edges.
88
-
89
-
The `.vrt` approach above solves the overlap issue, but for improved performance you can leave the tiles separate and add a buffer to each one. This is the code I used on the public API to do this:
90
-
91
-
92
-
```python
93
-
import os
94
-
from glob import glob
95
-
import subprocess
96
-
97
-
import rasterio
98
-
99
-
100
-
# Prepare paths.
101
-
input_pattern ='data/eudem/*.TIF'
102
-
input_paths =sorted(glob(input_pattern))
103
-
assert input_paths
104
-
vrt_path ='data/eudem-vrt/eudem.vrt'
105
-
output_dir ='data/eudem-buffered/'
106
-
os.makedirs(output_dir, exist_ok=True)
107
-
108
-
109
-
110
-
# EU-DEM specific options.
111
-
tile_size =1_000_000
112
-
buffer_size =50
113
-
114
-
for input_path in input_paths:
115
-
116
-
# Get tile bounds.
117
-
with rasterio.open(input_path) as f:
118
-
bottom =int(f.bounds.bottom)
119
-
left =int(f.bounds.left)
120
-
121
-
# For EU-DEM only: round this partial tile down to the nearest tile_size.
0 commit comments