-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (50 loc) · 3.03 KB
/
Dockerfile
File metadata and controls
62 lines (50 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM osgeo/grass-gis:main-ubuntu_wxgui
# Version of GRASS GIS Addons
ENV V_ALKIS_BUILDINGS_IMPORT_VERSION 1.1.0
ENV M_NEURAL_NETWORK_VERSION 2.1.1
# is this needed or already set in the base image?
# --->
SHELL ["/bin/bash", "-c"]
# set SHELL var to avoid /bin/sh fallback in interactive GRASS GIS sessions
ENV SHELL /bin/bash
ENV LC_ALL "en_US.UTF-8"
ENV GRASS_SKIP_MAPSET_OWNER_CHECK 1
# https://proj.org/usage/environmentvars.html#envvar-PROJ_NETWORK
ENV PROJ_NETWORK=ON
# <---
# use a Python venv for pip3 install
RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests python3-venv \
&& apt-get clean all \
&& rm -rf /var/lib/apt/lists/*
RUN /usr/bin/python3 -m venv --system-site-packages /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN python3 -m ensurepip && pip3 install --upgrade pip pep517 wheel
# set GRASS_ADDON_BASE
ENV GRASS_ADDON_BASE=/usr/local/grass
# install external dependencies
# do not use scikit-learn >=1.6 because it introduced breaking changes incompatible with r.learn.ml2
RUN pip3 install py7zr tqdm requests psutil "scikit-learn==1.5.2" pyproj pandas grass-gis-helpers
# for NN usage
RUN pip3 install albumentations torch pytorch-lightning segmentation_models.pytorch matplotlib
# Downgrade numpy (to be compatible with pytorch_lightning/torch)
RUN pip3 install numpy==1.26.4
# install official addons
RUN grass --tmp-project EPSG:4326 --exec g.extension r.mapcalc.tiled -s
RUN grass --tmp-project EPSG:4326 --exec g.extension v.centerpoint -s
RUN grass --tmp-project EPSG:4326 --exec g.extension r.learn.ml2 -s
# install addons from mundialis
RUN wget https://github.com/mundialis/v.alkis.buildings.import/archive/refs/tags/${V_ALKIS_BUILDINGS_IMPORT_VERSION}.zip \
&& grass --tmp-project EPSG:4326 --exec g.extension v.alkis.buildings.import url=${V_ALKIS_BUILDINGS_IMPORT_VERSION}.zip -s \
&& rm ${V_ALKIS_BUILDINGS_IMPORT_VERSION}.zip
RUN grass --tmp-project EPSG:4326 --exec g.extension m.neural_network url=https://github.com/mundialis/m.neural_network branch=${M_NEURAL_NETWORK_VERSION} -s
RUN grass --tmp-project EPSG:4326 --exec g.extension v.out.geojson url=https://github.com/mundialis/v.out.geojson -s
# install RVR-specific GRASS GIS addons
COPY grass-gis-addons /src/grass-gis-addons
RUN grass --tmp-project EPSG:4326 --exec g.extension r.import.dtm_nrw url=/src/grass-gis-addons/r.import.dtm_nrw -s
RUN grass --tmp-project EPSG:4326 --exec g.extension r.in.pdal.worker url=/src/grass-gis-addons/r.in.pdal.worker -s
RUN grass --tmp-project EPSG:4326 --exec g.extension r.import.ndsm_nrw url=/src/grass-gis-addons/r.import.ndsm_nrw -s
RUN grass --tmp-project EPSG:4326 --exec g.extension m.import.rvr url=/src/grass-gis-addons/m.import.rvr -s
RUN grass --tmp-project EPSG:4326 --exec g.extension m.analyse.trees url=/src/grass-gis-addons/m.analyse.trees -s
RUN grass --tmp-project EPSG:4326 --exec g.extension m.analyse.buildings url=/src/grass-gis-addons/m.analyse.buildings -s
RUN grass --tmp-project EPSG:4326 --exec g.extension r.dem.import url=https://github.com/mundialis/r.dem.import -s