Installation
R package
The R package can be installed from CRAN including binary package builds for MacOS and Windows:
install.packages("gdalcubes")
Alternatively, installing the development version from GitHub is easiest with
::install_git("https://github.com/appelmar/gdalcubes_R") remotes
Please make sure that the git command line client is available on your system. Otherwise, the above command might not clone the gdalcubes C++ library as a submodule under src/gdalcubes. The package links to the external libraries GDAL, NetCDF, and SQLite (see below).
Windows
On Windows, you will need Rtools to compile the package from sources. System libraries are automatically downloaded from rwinlib.
Linux
Please install the system libraries e.g. from the package manager of your Linux distribution. Also make sure that you are using a recent version of GDAL (> 2.3.0). On Ubuntu, the following commands install all required libraries.
sudo add-apt-repository ppa:ubuntugis/ppa && sudo apt-get update
sudo apt-get install libgdal-dev libnetcdf-dev libsqlite3-dev libudunits2-dev
MacOS
Use Homebrew to install system libraries with
brew install pkg-config
brew install gdal
brew install netcdf
brew install libgit2
brew install udunits
brew install curl
brew install sqlite
Docker with RStudio Server
The Dockerfile
at the root of the project presents an image that runs an RStudio Server instance with gdalcubes. You can build and run it in a container e.g. with:
docker build -t "appelmar/gdalcubes_demo" .
docker run -d --restart unless-stopped -p 8787:8787 -v $(pwd):/home/rstudio -e PASSWORD=PLEASECHANGE appelmar/gdalcubes_demo
C++ library and tools
The C++ library and relatated tools can be compiled from sources via CMake. CMake automatically checks for mandatory and optional dependencies and adapts the build configuration. The following commands install gdalcubes from sources.
Starting with gdalcubes version 0.6.4, the C++ library has been completely integrated into the R package source tree (under src/gdalcubes
). There is no separate repository anymore and the URL https://github.com/appelmar/gdalcubes now points to the R package repository (including the C++ library).
git clone https://github.com/appelmar/gdalcubes && cd gdalcubes/src/gdalcubes
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../
make
sudo make install
If any of the required libraries are not available on your system, please use your package manager to install these before, e.g. with (Ubuntu):
sudo apt-get install libgdal-dev libnetcdf-dev libcurl4-openssl-dev libsqlite3-dev
# additional installs for command line interface
sudo apt-get install libboost-program-options-dev libboost-system-dev
# additional installs for server executable
sudo apt-get install libcpprest-dev
Please notice that we have not yet tried to build with Microsoft Visual Studio. However, the R package installation from sources includes building the C++ library and works on Windows, MacOS and Linux (see R package installation).
Docker
The C++ library under src/gdalcubes
contains a ready-to-use Docker image that is built on top of a minimal Ubuntu installation. The image includes installation of all dependencies and compiles gdalcubes from sources automatically.
The following commands can be used to build the image and run containers.
git clone https://github.com/appelmar/gdalcubes && cd gdalcubes
docker build -t appelmar/gdalcubes .
docker run -d -p 11111:1111 appelmar/gdalcubes # runs gdalcubes_server as a deamon
docker run appelmar/gdalcubes /bin/bash # run a command line where you can run gdalcubes