-
Notifications
You must be signed in to change notification settings - Fork 181
/
install_geospatial.sh
executable file
·95 lines (86 loc) · 1.88 KB
/
install_geospatial.sh
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
set -e
# always set this for scripts but don't declare as ENV..
export DEBIAN_FRONTEND=noninteractive
## build ARGs
NCPUS=${NCPUS:--1}
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
apt_install \
gdal-bin \
lbzip2 \
libfftw3-dev \
libgdal-dev \
libgeos-dev \
libgsl0-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libhdf4-alt-dev \
libhdf5-dev \
libjq-dev \
libpq-dev \
libproj-dev \
libprotobuf-dev \
libnetcdf-dev \
libsqlite3-dev \
libssl-dev \
libudunits2-dev \
netcdf-bin \
postgis \
protobuf-compiler \
sqlite3 \
tk-dev \
unixodbc-dev
install2.r --error --skipmissing --skipinstalled -n "$NCPUS" \
RColorBrewer \
RandomFields \
RNetCDF \
classInt \
deldir \
gstat \
hdf5r \
lidR \
mapdata \
maptools \
mapview \
ncdf4 \
proj4 \
raster \
rgdal \
rgeos \
rlas \
sf \
sfarrow \
sp \
spacetime \
spatstat \
spatialreg \
spdep \
stars \
terra \
tidync \
tmap \
geoR \
geosphere \
BiocManager
R -e "BiocManager::install('rhdf5')"
## install wgrib2 for NOAA's NOMADS / rNOMADS forecast files
## This is no longer needed, but we include it for reproducibility
## reasons on earlier base images.
source /etc/os-release
if [ "${UBUNTU_CODENAME}" == "focal" ]; then
/rocker_scripts/install_wgrib2.sh
fi
# Clean up
rm -rf /var/lib/apt/lists/*
rm -r /tmp/downloaded_packages
## Strip binary installed lybraries from RSPM
## https://github.com/rocker-org/rocker-versioned2/issues/340
strip /usr/local/lib/R/site-library/*/libs/*.so