Repository Public
1#!/bin/bash2# =============================================================================3# SP BOUCHER | INFRASTRUCTURE & AUTOMATION4# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project : KA Maps Engine8# File : server/pipeline/dem/fetch_dem.sh9# Module : server10# Repository : https://git.spboucher.ai/ka-maps-engine11# Created : 2026-12-0112# Last Modified : 2026-12-0113#14# Author : Simon-Pierre Boucher15# Position : Professor of Finance16# Institution : Université du Québec en Outaouais (UQO)17# Organization : SP Boucher18# Website : https://spboucher.ai19# Git : https://git.spboucher.ai20#21# Preferred Contact: support@spboucher.ai22# Technical Contact: dev@spboucher.ai23# Security/Admin : admin@spboucher.ai24#25# Copyright (c) 202626# Simon-Pierre Boucher27# All rights reserved where applicable. This file is governed by the28# applicable project license, copyright notices and relevant law.29# Existing third-party rights and notices remain unaffected.30#31# License : None specified (no license file in this repository)32#33# Do not embed credentials, private keys, access tokens,34# certificates or confidential personal information.35#36# =============================================================================37# END OF SP BOUCHER SOURCE HEADER38# =============================================================================3940# KA Maps — téléchargement des sources de relief (≈ 86 Go). Licences : docs/DATA_LICENSING.md.41set -euo pipefail42SRC=${SRC:-/var/lib/kamaps/src/dem}43mkdir -p "$SRC"/{mrdem,etopo,glo30}44( cd "$SRC/mrdem" && aria2c -x16 -s16 -k64M --file-allocation=none -c \45 https://canelevation-dem.s3.ca-central-1.amazonaws.com/mrdem-30/mrdem-30-dtm.tif )46( cd "$SRC/etopo" && aria2c -x8 -s8 -c \47 https://www.ngdc.noaa.gov/mgg/global/relief/ETOPO2022/data/30s/30s_surface_elev_gtif/ETOPO_2022_v1_30s_N90W180_surface.tif )48cd "$SRC/glo30"49# Cellules 1° x 1° de la frange sud (États-Unis) ; les cellules en mer n'existent pas (404 ignoré).50for lat in 44 45 46 47; do for lon in $(seq 57 81); do51 n=$(printf "Copernicus_DSM_COG_10_N%02d_00_W%03d_00_DEM" "$lat" "$lon")52 echo "https://copernicus-dem-30m.s3.amazonaws.com/$n/$n.tif"53done; done | xargs -P 8 -n 1 curl -sfO || true54gdalbuildvrt -overwrite glo30.vrt Copernicus_DSM_COG_10_*.tif55