10000 add geoparquet/arrow drivers for GDAL by cboettig · Pull Request #633 · rocker-org/rocker-versioned2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

add geoparquet/arrow drivers for GDAL #633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 21, 2023
28 changes: 20 additions & 8 deletions scripts/experimental/install_dev_osgeo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ GEOS_VERSION=${GEOS_VERSION:-"latest"}
CRAN=${CRAN_SOURCE:-"https://cloud.r-project.org"}
echo "options(repos = c(CRAN = '${CRAN}'))" >>"${R_HOME}/etc/Rprofile.site"

# cmake does not understand "-1" as "all cpus"
CMAKE_CORES=${NCPUS}
if [ "${CMAKE_CORES}" = "-1" ]; then
CMAKE_CORES=$(nproc --all)
fi

# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
Expand All @@ -33,6 +39,7 @@ export DEBIAN_FRONTEND=noninteractive
apt_install \
gdb \
git \
lsb-release \
libcairo2-dev \
libcurl4-openssl-dev \
libexpat1-dev \
Expand Down Expand Up @@ -64,6 +71,11 @@ apt_install \
cmake \
libtiff5-dev

## geoparquet support
wget https://apache.jfrog.io/artifactory/arrow/"$(lsb_release --id --short | tr '[:upper:]' '[:lower:]')"/apache-arrow-apt-source-latest-"$(lsb_release --codename --short)".deb
apt_install -y -V ./apache-arrow-apt-source-latest-"$(lsb_release --codename --short)".deb
apt-get update && apt-get install -y -V libarrow-dev libparquet-dev libarrow-dataset-dev

LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

# install geos
Expand All @@ -72,6 +84,9 @@ if [ "$GEOS_VERSION" = "latest" ]; then
GEOS_VERSION=$(wget -qO- "https://api.github.com/repos/libgeos/geos/git/refs/tags" | grep -oP "(?<=\"ref\":\s\"refs/tags/)\d+\.\d+\.\d+" | tail -n -1)
fi

## purge existing directories to permit re-run of script with updated versions
rm -rf geos* proj* gdal*

wget https://download.osgeo.org/geos/geos-"${GEOS_VERSION}".tar.bz2
bzip2 -d geos-*bz2
tar xf geos*tar
Expand All @@ -80,9 +95,7 @@ cd geos*
mkdir build
cd build
cmake ..
make
make install
cd ../..
cmake --build . --parallel "$CMAKE_CORES" --target install
ldconfig

# install proj
Expand All @@ -100,8 +113,7 @@ cd proj-*
mkdir build
cd build
cmake ..
make
make install
cmake --build . --parallel "$CMAKE_CORES" --target install
cd ../..
ldconfig

Expand All @@ -119,9 +131,9 @@ rm gdal*tar.gz
cd gdal*
mkdir build
cd ./build
# cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_JAVA_BINDINGS:BOOL=OFF -DBUILD_CSHARP_BINDINGS:BOOL=OFF
cmake -DCMAKE_BUILD_TYPE=Release ..
make
make install
cmake --build . --parallel "$CMAKE_CORES" --target install
ldconfig

install2.r --error --skipmissing --skipinstalled -n "$NCPUS" \
Expand Down Expand Up @@ -157,7 +169,7 @@ install2.r --error --skipmissing --skipinstalled -n "$NCPUS" \

# Clean up
rm -rf /var/lib/apt/lists/*
rm -r /tmp/downloaded_packages
rm -rf /tmp/downloaded_packages

# Check the geospatial packages

Expand Down
0