Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# dem.cpp: https://www.ecoris.co.jp/contents/demtool.html
FROM osgeo/gdal
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /tmp
RUN apt update
RUN apt -y install build-essential
RUN wget -O dem.cpp https://gist.githubusercontent.com/kemasoft-gist/4af0d9f60b27487d984a0d2ea7e61624/raw
RUN g++ dem.cpp -odem -lgdal
FROM alpine
WORKDIR /tmp
RUN apk update
RUN apk add w3m
# zdem2tif: https://qiita.com/HidKamiya/items/66b1d98503301446460c
RUN w3m -dump https://qiita.com/HidKamiya/items/66b1d98503301446460c \
| sed -n '/import os/,/main(sys.argv)/p' >zdem2tif
RUN sed -i '1i#!/usr/bin/env python3' zdem2tif
RUN chmod a+x zdem2tif
# fgddem: https://github.com/minorua/fgddem.py
RUN wget -O fgddem https://raw.githubusercontent.com/minorua/fgddem.py/master/fgddem.py
RUN sed -i '/merge_command.*gdalwarp.*gdalwarp_options/s/"%s"/%s/' fgddem
RUN chmod a+x fgddem
# copy dem, zdem2tif
FROM osgeo/gdal
WORKDIR /usr/local/bin/
COPY --from=0 /tmp/dem .
COPY --from=1 /tmp/zdem2tif .
COPY --from=1 /tmp/fgddem .
WORKDIR /mnt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.