Skip to content
Commits on Source (17)
......@@ -72,11 +72,11 @@ A test run (assuming you have existing GRASS GIS location; it can be downloaded
```
# case 1: launching in the grassdata directory in which the location is stored:
docker run -it --rm --user=$(id -u):$(id -g) --volume $(pwd):/data --env HOME=/data/ grassgis78 \
grass --text nc_spm_08_grass7/user1 --exec g.region -p
grass --text nc_basic_spm_grass7/user1 --exec g.region -p
# case 2: launching anywhere
docker run -it --rm --user=$(id -u):$(id -g) --volume /your/test/grassdata/:/data --env HOME=/data/ grassgis78 \
grass /data/nc_basic_spm/PERMANENT --exec g.region -p
grass /data/nc_basic_spm_grass7/PERMANENT --exec g.region -p
```
Note that the first `grassgis78` is the name of the image while the second
......@@ -86,9 +86,9 @@ To run the tests (again assuming local location):
```
docker run -it --rm --user=$(id -u):$(id -g) --volume /your/test/grassdata/:/data --env HOME=/data/ -w /code/grass \
grassgis78 grass /data/nc_basic_spm/PERMANENT --exec \
grassgis78 grass /data/nc_basic_spm_grass7/PERMANENT --exec \
python -m grass.gunittest.main \
--location nc_basic_spm --location-type nc
--location nc_basic_spm_grass7 --location-type nc
```
Note: If you compiled locally before building the Docker image, you may
......
......@@ -211,6 +211,8 @@ newer versions are named "python-pillow"
<a href="https://git-scm.com/">https://git-scm.com/</a><br>
</li>
<li><b>Subversion</b> (svn in g.extension to fetch code selectively from grass-addons on GitHub)<br>
<a href="https://subversion.apache.org/">https://subversion.apache.org/</a><br>
</ul>
......
......@@ -63,15 +63,16 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
"proj-bin",
"libreadline-dev",
"libsqlite3-dev",
"libwxgtk3.0-dev",
"libwxgtk3.0-gtk3-dev",
"libxmu-dev",
"python",
"python-wxgtk3.0",
"python-dev",
"python-numpy",
"python-ply",
"python-pil",
"python-six",
"python3",
"python3-wxgtk4.0",
"python3-dateutil",
"python3-dev",
"python3-numpy",
"python3-ply",
"python3-pil",
"python3-six",
"libnetcdf-dev",
"netcdf-bin",
"libblas-dev",
......
grass (7.8.0~rc1-1~exp2) UNRELEASED; urgency=medium
grass (7.8.1~rc1-1~exp1) experimental; urgency=medium
* New upstream release candidate.
-- Bas Couwenberg <sebastic@debian.org> Wed, 30 Oct 2019 05:13:19 +0100
grass (7.8.0-2) unstable; urgency=medium
* Bump Standards-Version to 4.4.1, no changes.
* Switch to wxWidgets GTK 3 implementation.
(closes: #943440)
-- Bas Couwenberg <sebastic@debian.org> Fri, 25 Oct 2019 06:20:37 +0200
grass (7.8.0-1) unstable; urgency=medium
* New upstream release.
* Recommend both git & subversion for g.extension.
* Drop unused override for spelling-error-in-binary.
* Don't define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H, proj.h is used.
* Move from experimental to unstable.
-- Bas Couwenberg <sebastic@debian.org> Sat, 31 Aug 2019 10:23:18 +0200
-- Bas Couwenberg <sebastic@debian.org> Sat, 07 Sep 2019 09:31:16 +0200
grass (7.8.0~rc1-1~exp1) experimental; urgency=medium
......@@ -23,6 +40,14 @@ grass (7.8.0~rc1-1~exp1) experimental; urgency=medium
-- Bas Couwenberg <sebastic@debian.org> Wed, 14 Aug 2019 19:47:24 +0200
grass (7.6.1-4) unstable; urgency=medium
* Update PIE hardening conditional, trusty is EOL.
* Drop unused override for spelling-error-in-binary.
* No change rebuild with PDAL 2.0.1.
-- Bas Couwenberg <sebastic@debian.org> Wed, 04 Sep 2019 19:16:06 +0200
grass (7.6.1-3) unstable; urgency=medium
* No change rebuild for PDAL mini transition.
......
......@@ -34,7 +34,7 @@ Build-Depends: autoconf2.13,
libreadline-dev,
libsqlite3-dev,
libtiff-dev,
libwxgtk3.0-dev,
libwxgtk3.0-gtk3-dev,
libxmu-dev,
libzstd-dev,
lsb-release,
......@@ -52,7 +52,7 @@ Build-Depends: autoconf2.13,
python3-wxgtk4.0,
unixodbc-dev,
zlib1g-dev
Standards-Version: 4.4.0
Standards-Version: 4.4.1
Vcs-Browser: https://salsa.debian.org/debian-gis-team/grass
Vcs-Git: https://salsa.debian.org/debian-gis-team/grass.git -b experimental
Homepage: https://grass.osgeo.org/
......
......@@ -6,9 +6,6 @@
# Enable hardening build flags
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
# Workaround for proj_api.h deprecation in PROJ 6.0.0
export DEB_CFLAGS_MAINT_APPEND=-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
# Disable PIE on Ubuntu where it's still problematic
VENDOR_DERIVES_FROM_UBUNTU ?= $(shell dpkg-vendor --derives-from Ubuntu && echo yes)
DISTRIBUTION_RELEASE := $(shell lsb_release -cs)
......
......@@ -5,6 +5,7 @@ import tempfile
from grass.script import core as grass
from grass.script import task as gtask
from grass.exceptions import CalledModuleError
# read environment variables from file
def read_env_file(env_file):
......@@ -39,8 +40,8 @@ def render(cmd, mapfile):
env['GRASS_RENDER_FILE'] = mapfile
try:
grass.run_command(cmd[0], env=env, **cmd[1])
except Exception as e:
grass.debug(1, "Unable to render: {0}".format(e))
except CalledModuleError as e:
grass.debug("Unable to render: {0}".format(e), 1)
# update cmd file
def update_cmd_file(cmd_file, cmd, mapfile):
......
......@@ -70,6 +70,7 @@ rm -f locale/po/messages.mo
rm -f demolocation/PERMANENT/.bash*
find . -name '*~' | xargs rm
find . -name '*.bak' | xargs rm
find . -name '*.swp' | xargs rm
find . -name '.#*' | xargs rm
find . -name '*.orig' | xargs rm
find . -name '*.rej' | xargs rm
......@@ -91,23 +92,19 @@ git status
### Update VERSION file to release version number
TODO: probably better done in GH interface?!
Directly edit in GH interface:
```bash
vim include/VERSION
https://github.com/OSGeo/grass/blob/releasebranch_7_8/include/VERSION
Example:
#example:
```bash
7
8
0RC1
1RC1
2019
```
Cleanup:
```bash
rm -f include/VERSION~
```
~~Update OSGeo4W setup.hint file~~
~~no longer needed~~
~~vim mswindows/osgeo4w/setup_x86.hint.tmpl~~
......@@ -117,7 +114,7 @@ rm -f include/VERSION~
See https://help.github.com/en/articles/creating-releases
Done in GH interface.
Preparation:
### Changelog and tagging etc
......@@ -126,14 +123,9 @@ Done in GH interface.
MAJOR=`cat include/VERSION | head -1 | tail -1`
MINOR=`cat include/VERSION | head -2 | tail -1`
RELEASE=`cat include/VERSION | head -3 | tail -1`
VERSION=${MAJOR}_${MINOR}_${RELEASE}
VERSION=${MAJOR}.${MINOR}.${RELEASE}
echo $VERSION
git checkout -b release_GRASS_GIS_$VERSION
git add include/VERSION
git commit -m"GRASS GIS $VERSION" include/VERSION
git push origin release_GRASS_GIS_$VERSION
# Create Changelog file on release branch:
python tools/gitlog2changelog.py
mv ChangeLog ChangeLog_$VERSION
......@@ -148,16 +140,26 @@ echo $RELEASETAG
### Tag release (on GitHub)
```bash
echo "grass_$VERSION"
echo "$VERSION"
```
Do this in https://github.com/OSGeo/grass/releases/new
Done in GH interface:
https://github.com/OSGeo/grass/releases/new
### Packaging of source code tarball
TODO: add checkout of code via release tag
TODO: add checkout of code via release tag (?)
```bash
# update from GH
# assumptions:
# - own fork as "origin"
# - remote repo as "upstream"
git fetch --all --prune && git checkout releasebranch_7_8 && \
git merge upstream/releasebranch_7_8 && git push origin releasebranch_7_8
# create source package (in the source directory):
echo grass-${VERSION}
......@@ -174,23 +176,17 @@ md5sum grass-${VERSION}.tar.gz > grass-${VERSION}.md5sum
### Reset include/VERSION file to git version:
TODO: probably better done in GH interface
Directly edit in GH interface:
```bash
vim include/VERSION
https://github.com/OSGeo/grass/blob/releasebranch_7_8/include/VERSION
Example:
#example
```bash
7
8
0dev
1dev
2019
rm -f include/VERSION~
git checkout -b back_to_git_dev
git add include/VERSION
git commit -m"back to git" include/VERSION
git push origin back_to_git_dev
# open PR and merge
```
### Upload source code tarball to OSGeo servers
......
How the GRASS Webserver and related infrastructure works
written by M. Neteler
Last changed: June 2019
Last changed: Oct 2019
Related Wiki documents:
* https://grass.osgeo.org/wiki/GRASS_Migration_to_OSGeo (historical document)
== GRASS Source code repository ==
Maintainer: Markus Neteler, Martin Landa, OSGeo-SAC, http://wiki.osgeo.org/wiki/SAC
Important update April 2019: The source code is now managed on GitHub (rather than in SVN).
The new GitHub repositories are:
* GRASS GIS core (7.x): https://github.com/OSGeo/grass
* GRASS GIS legacy (3.x-6.x): https://github.com/OSGeo/grass-legacy
* GRASS GIS Add-ons: https://github.com/OSGeo/grass-addons
* GRASS GIS promotional material: https://github.com/OSGeo/grass-promo
* GRASS GIS Website (future site): https://github.com/OSGeo/grass-website
* Github mirror at OSGeo: https://git.osgeo.org/gitea/grass_gis/grass
* Git usage: https://trac.osgeo.org/grass/wiki/HowToGit
Still trac at OSGeo is used for tickets: https://trac.osgeo.org/grass
For easier linking in the Trac Wiki, some macro definitions are used for manual page refs (G7:modulename)
* https://trac.osgeo.org/grass/wiki/InterMapTxt
ZIP file download support in trac (was needed for g.extension) - on trac.osgeo.org:
/var/www/trac/grass/conf/trac.ini
[browser]
downloadable_paths = /grass-addons/grass7/*/*,/sandbox/*/*
Statistics:
https://trac.osgeo.org/grass/stats/code
== GRASS Web server ==
Maintainer: M. Neteler
......@@ -138,25 +167,6 @@ Web based client: See http://grasswiki.osgeo.org/wiki/IRC
- Soeren ("huhabla")
- Brad ("bdouglas")
== GRASS Source code repository ==
Maintainer: Markus Neteler, Martin Landa, OSGeo-SAC, http://wiki.osgeo.org/wiki/SAC
* https://trac.osgeo.org/grass/browser
* SVN: https://trac.osgeo.org/grass/wiki/HowToSVN
Trac Wiki Macro definitions for manual pages G7:modulename
* https://trac.osgeo.org/grass/wiki/InterMapTxt
ZIP file download support in trac (needed for g.extension) - on trac.osgeo.org:
/var/www/trac/grass/conf/trac.ini
[browser]
downloadable_paths = /grass-addons/grass7/*/*,/sandbox/*/*
Statistics:
https://trac.osgeo.org/grass/stats/code
== GRASS Bugtracker ==
Future bugtracker
......
# Docker GRASS GIS (alpine linux)
Dockerfile with an [Alpine Linux](https://www.alpinelinux.org/) image with [GRASS GIS](https://grass.osgeo.org/) and [grass-session](https://github.com/zarch/grass-session/).
Download size of this image is only approximately 80 MB.
Build the docker with:
```bash
$ sudo docker build --build-arg GRASS_VERSION=7.8 \
--build-arg PYTHON_VERSION=3 \
--build-arg PROJ_VERSION=5.2.0 \
--build-arg PROJ_DATUMGRID_VERSION=1.8 \
.
```
View the images available using `sudo docker images` and open a bash terminal with:
```bash
$ sudo docker run -i -t 15550df91610 /bin/bash
bash-5.0#
```
......@@ -2,11 +2,10 @@ FROM alpine:edge
# Based on:
# https://github.com/mundialis/docker-grass-gis/blob/master/Dockerfile
LABEL authors="Pietro Zambelli"
LABEL maintainer="peter.zamb@gmail.com"
LABEL authors="Pietro Zambelli,Markus Neteler"
LABEL maintainer="peter.zamb@gmail.com,neteler@osgeo.org"
# PACKAGES VERSIONS
ARG GRASS_VERSION=7.8
ARG PYTHON_VERSION=3
ARG PROJ_VERSION=5.2.0
ARG PROJ_DATUMGRID_VERSION=1.8
......@@ -15,12 +14,13 @@ ARG PROJ_DATUMGRID_VERSION=1.8
# CONFIG VARIABLES
# ================
# set configuration options
# set configuration options, without wxGUI
ENV GRASS_CONFIG="\
--enable-largefile \
--with-cxx \
--with-proj --with-proj-share=/usr/share/proj \
--with-gdal \
--with-pdal \
--with-python \
--with-geos \
--with-sqlite \
......@@ -64,6 +64,7 @@ ENV PACKAGES="\
gettext \
geos \
gnutls \
laszip \
libbz2 \
libjpeg-turbo \
libpng \
......@@ -72,6 +73,7 @@ ENV PACKAGES="\
ncurses \
openjpeg \
openblas \
pdal \
py3-numpy \
py3-pillow \
py3-six \
......@@ -94,13 +96,17 @@ ENV PACKAGES="\
gdal-dev \
geos-dev \
gnutls-dev \
laszip-dev \
libc6-compat \
libjpeg-turbo-dev \
libpng-dev \
make \
openjpeg-dev \
openblas-dev \
pdal-dev \
postgresql-dev \
python3-dev \
py3-numpy-dev \
sqlite-dev \
tar \
tiff-dev \
......@@ -142,15 +148,15 @@ RUN echo "Install main packages";\
--virtual .build-deps $GRASS_BUILD_PACKAGES; \
# echo LANG="en_US.UTF-8" > /etc/default/locale;
#
# install the latest projection library for GRASS GIS
# install the latest (and compatible) projection library for GRASS GIS
#
echo "Install PROJ-$PROJ_VERSION";\
echo " => Dowload proj-$PROJ_VERSION";\
wget http://download.osgeo.org/proj/proj-$PROJ_VERSION.tar.gz && \
echo " => Downloading proj-$PROJ_VERSION";\
wget -q http://download.osgeo.org/proj/proj-$PROJ_VERSION.tar.gz && \
tar xzvf proj-$PROJ_VERSION.tar.gz && \
cd /src/proj-$PROJ_VERSION/ && \
echo " => Dowload datumgrid-$PROJ_DATUMGRID_VERSION" &&\
wget http://download.osgeo.org/proj/proj-datumgrid-$PROJ_DATUMGRID_VERSION.zip && \
echo " => Downloading datumgrid-$PROJ_DATUMGRID_VERSION" &&\
wget -q http://download.osgeo.org/proj/proj-datumgrid-$PROJ_DATUMGRID_VERSION.zip && \
cd nad && \
unzip ../proj-datumgrid-$PROJ_DATUMGRID_VERSION.zip && \
cd .. && \
......@@ -165,16 +171,12 @@ RUN echo "Install main packages";\
# Checkout and install GRASS GIS
#
echo "Install GRASS GIS";\
echo " => Dowload grass-$GRASS_VERSION";\
wget https://grass.osgeo.org/grass`echo $GRASS_VERSION | tr -d .`/source/snapshot/grass-$GRASS_VERSION.git_src_snapshot_latest.tar.gz && \
# unpack source code package and remove tarball archive:
mkdir /src/grass_build && \
tar xfz grass-$GRASS_VERSION.git_src_snapshot_latest.tar.gz --strip=1 -C /src/grass_build && \
rm -f grass-$GRASS_VERSION.git_src_snapshot_latest.tar.gz; \
#
echo " => Downloading grass"
COPY . /src/grass_build/
# Configure compile and install GRASS GIS
#
echo " => Configure and compile grass";\
RUN echo " => Configure and compile grass";\
cd /src/grass_build && \
/src/grass_build/configure $GRASS_CONFIG && \
make -j $NUMTHREADS && \
......@@ -223,6 +225,18 @@ RUN pip install grass-session
# set GRASSBIN
ENV GRASSBIN="/usr/local/bin/grass"
# ===========================
# TEST grass-session and PDAL
# ===========================
WORKDIR /tmp
COPY docker/testdata/simple.laz .
WORKDIR /scripts
COPY docker/testdata/test_grass_session.py .
## just scan the LAZ file
# TODO: fix test
#RUN /usr/bin/python3 /scripts/test_grass_session.py
# ========
# FINALIZE
# ========
......@@ -236,7 +250,9 @@ VOLUME /grassdb
ENV GRASS_SKIP_MAPSET_OWNER_CHECK=1 \
LC_ALL="en_US.UTF-8"
# debug
RUN $GRASSBIN --config svn_revision version
# show installed version
RUN grass --tmp-location EPSG:4326 --exec g.version -rge && \
pdal --version && \
python3 --version
CMD [$GRASSBIN, "--version"]
......@@ -21,6 +21,7 @@ ENV GRASS_CONFIG="\
--with-cxx \
--with-proj --with-proj-share=/usr/share/proj \
--with-gdal \
--with-pdal \
--with-python \
--with-geos \
--with-sqlite \
......@@ -66,6 +67,7 @@ ENV PACKAGES="\
geos \
gnutls \
gtk+3.0 \
laszip \
libbz2 \
libjpeg-turbo \
libpng \
......@@ -74,6 +76,7 @@ ENV PACKAGES="\
ncurses \
openjpeg \
openblas \
pdal \
py3-numpy \
py3-pillow \
py3-six \
......@@ -99,15 +102,17 @@ ENV PACKAGES="\
geos-dev \
gnutls-dev \
gtk+3.0-dev \
laszip-dev \
libc6-compat \
libjpeg-turbo-dev \
libpng-dev \
make \
openjpeg-dev \
openblas-dev \
pdal-dev \
postgresql-dev \
python3-dev \
py-numpy-dev \
py3-numpy-dev \
sqlite-dev \
tar \
tiff-dev \
......@@ -154,15 +159,15 @@ RUN echo "Install main packages";\
# compile wxPython, unfortunately there is no Alpine package (yet) - compilation is slow, though!
$PYTHONBIN -m pip install -U pathlib2 wxPython && \
#
# install the latest projection library for GRASS GIS
# install the latest (and compatible) projection library for GRASS GIS
#
echo "Install PROJ-$PROJ_VERSION";\
echo " => Dowload proj-$PROJ_VERSION";\
wget http://download.osgeo.org/proj/proj-$PROJ_VERSION.tar.gz && \
echo " => Downloading proj-$PROJ_VERSION";\
wget -q http://download.osgeo.org/proj/proj-$PROJ_VERSION.tar.gz && \
tar xzvf proj-$PROJ_VERSION.tar.gz && \
cd /src/proj-$PROJ_VERSION/ && \
echo " => Dowload datumgrid-$PROJ_DATUMGRID_VERSION" &&\
wget http://download.osgeo.org/proj/proj-datumgrid-$PROJ_DATUMGRID_VERSION.zip && \
echo " => Downloading datumgrid-$PROJ_DATUMGRID_VERSION" &&\
wget -q http://download.osgeo.org/proj/proj-datumgrid-$PROJ_DATUMGRID_VERSION.zip && \
cd nad && \
unzip ../proj-datumgrid-$PROJ_DATUMGRID_VERSION.zip && \
cd .. && \
......@@ -177,16 +182,12 @@ RUN echo "Install main packages";\
# Checkout and install GRASS GIS
#
echo "Install GRASS GIS";\
echo " => Dowload grass-$GRASS_VERSION";\
wget https://grass.osgeo.org/grass`echo $GRASS_VERSION | tr -d .`/source/snapshot/grass-$GRASS_VERSION.git_src_snapshot_latest.tar.gz && \
# unpack source code package and remove tarball archive:
mkdir /src/grass_build && \
tar xfz grass-$GRASS_VERSION.git_src_snapshot_latest.tar.gz --strip=1 -C /src/grass_build && \
rm -f grass-$GRASS_VERSION.git_src_snapshot_latest.tar.gz; \
#
echo " => Downloading grass"
COPY . /src/grass_build/
# Configure compile and install GRASS GIS
#
echo " => Configure and compile grass";\
RUN echo " => Configure and compile grass";\
cd /src/grass_build && \
/src/grass_build/configure $GRASS_CONFIG && \
make -j $NUMTHREADS && \
......@@ -235,6 +236,18 @@ RUN pip install grass-session
# set GRASSBIN
ENV GRASSBIN="/usr/local/bin/grass"
# ===========================
# TEST grass-session and PDAL
# ===========================
WORKDIR /tmp
COPY docker/testdata/simple.laz .
WORKDIR /scripts
COPY docker/testdata/test_grass_session.py .
## just scan the LAZ file
# TODO: fix test
#RUN /usr/bin/python3 /scripts/test_grass_session.py
# ========
# FINALIZE
# ========
......@@ -248,7 +261,9 @@ VOLUME /grassdb
ENV GRASS_SKIP_MAPSET_OWNER_CHECK=1 \
LC_ALL="en_US.UTF-8"
# debug
RUN $GRASSBIN --config svn_revision version
# show installed version
RUN grass --tmp-location EPSG:4326 --exec g.version -rge && \
pdal --version && \
python3 --version
CMD [$GRASSBIN, "--version"]
# Docker GRASS GIS (alpine linux)
Dockerfile with an [Alpine Linux](https://www.alpinelinux.org/) image with [GRASS GIS](https://grass.osgeo.org/), [PDAL](https://pdal.io) support and [grass-session](https://github.com/zarch/grass-session/).
Download size of this image is only approximately 80 MB.
Clone this repository and change directory:
```bash
$ git clone https://github.com/OSGeo/grass.git
$ cd grass
```
__Build the docker with__:
```bash
$ docker build \
--file docker/alpine/Dockerfile_alpine \
--tag grass-py3-pdal:latest-alpine .
```
View the images available using `sudo docker images` and open a bash terminal with:
```bash
$ docker run -it grass-py3-pdal:latest-alpine /bin/bash
bash-5.0#
```
__To build a stable version__:
change to the releasebranch or tag you want to build:
```bash
$ git checkout remotes/origin/releasebranch_7_8
```
and build and enter with:
```bash
$ docker build \
-f docker/alpine/Dockerfile_alpine \
-t grass-py3-pdal:stable-alpine .
$ docker run -it grass-py3-pdal:stable-alpine /bin/bash
bash-5.0#
```
FROM debian:10.1
LABEL authors="Carmen Tawalika,Markus Neteler,Anika Bettge"
LABEL maintainer="tawalika@mundialis.de,neteler@mundialis.de,bettge@mundialis.de"
ENV DEBIAN_FRONTEND noninteractive
# define versions to be used
ARG PDAL_VERSION=1.8.0
ARG PROJ_VERSION=5.2.0
ARG PROJ_DATUMGRID_VERSION=1.8
ARG LAZ_PERF_VERSION=1.3.0
SHELL ["/bin/bash", "-c"]
WORKDIR /tmp
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y --no-install-recommends --no-install-suggests \
build-essential \
bison \
bzip2 \
cmake \
curl \
flex \
g++ \
gcc \
gdal-bin \
git \
libbz2-dev \
libcairo2 \
libcairo2-dev \
libcurl4-gnutls-dev \
libfftw3-bin \
libfftw3-dev \
libfreetype6-dev \
libgdal-dev \
libgeos-dev \
libgsl0-dev \
libjpeg-dev \
libjsoncpp-dev \
libopenblas-base \
libopenblas-dev \
libnetcdf-dev \
libncurses5-dev \
libopenjp2-7 \
libopenjp2-7-dev \
libpnglite-dev \
libpq-dev \
libpython3-all-dev \
libsqlite3-dev \
libtiff-dev \
libzstd-dev \
locales \
make \
mesa-common-dev \
moreutils \
ncurses-bin \
netcdf-bin \
python3 \
python3-dateutil \
python3-dev \
python3-magic \
python3-numpy \
python3-pil \
python3-pip \
python3-ply \
python3-setuptools \
python3-venv \
software-properties-common \
sqlite3 \
subversion \
unzip \
vim \
wget \
zip \
zlib1g-dev
RUN echo LANG="en_US.UTF-8" > /etc/default/locale
RUN echo en_US.UTF-8 UTF-8 >> /etc/locale.gen && locale-gen
## install the latest projection library for GRASS GIS
WORKDIR /src
RUN wget -q http://download.osgeo.org/proj/proj-${PROJ_VERSION}.tar.gz && \
tar xzf proj-${PROJ_VERSION}.tar.gz && \
cd /src/proj-${PROJ_VERSION}/ && \
wget -q http://download.osgeo.org/proj/proj-datumgrid-${PROJ_DATUMGRID_VERSION}.zip && \
cd nad && \
unzip ../proj-datumgrid-${PROJ_DATUMGRID_VERSION}.zip && \
cd .. && \
./configure --prefix=/usr/ && \
make && \
make install
## install laz-perf
RUN apt-get install cmake
WORKDIR /src
RUN wget -q https://github.com/hobu/laz-perf/archive/${LAZ_PERF_VERSION}.tar.gz -O laz-perf-${LAZ_PERF_VERSION}.tar.gz && \
tar -zxf laz-perf-${LAZ_PERF_VERSION}.tar.gz && \
cd laz-perf-${LAZ_PERF_VERSION} && \
mkdir build && \
cd build && \
cmake .. && \
make && \
make install
## fetch vertical datums and store into PROJ dir
WORKDIR /src
RUN mkdir vdatum && \
cd vdatum && \
wget -q http://download.osgeo.org/proj/vdatum/usa_geoid2012.zip && unzip -j -u usa_geoid2012.zip -d /usr/share/proj; \
wget -q http://download.osgeo.org/proj/vdatum/usa_geoid2009.zip && unzip -j -u usa_geoid2009.zip -d /usr/share/proj; \
wget -q http://download.osgeo.org/proj/vdatum/usa_geoid2003.zip && unzip -j -u usa_geoid2003.zip -d /usr/share/proj; \
wget -q http://download.osgeo.org/proj/vdatum/usa_geoid1999.zip && unzip -j -u usa_geoid1999.zip -d /usr/share/proj; \
wget -q http://download.osgeo.org/proj/vdatum/vertcon/vertconc.gtx && mv vertconc.gtx /usr/share/proj; \
wget -q http://download.osgeo.org/proj/vdatum/vertcon/vertcone.gtx && mv vertcone.gtx /usr/share/proj; \
wget -q http://download.osgeo.org/proj/vdatum/vertcon/vertconw.gtx && mv vertconw.gtx /usr/share/proj; \
wget -q http://download.osgeo.org/proj/vdatum/egm96_15/egm96_15.gtx && mv egm96_15.gtx /usr/share/proj; \
wget -q http://download.osgeo.org/proj/vdatum/egm08_25/egm08_25.gtx && mv egm08_25.gtx /usr/share/proj; \
cd .. && \
rm -rf vdatum
## install pdal
ENV NUMTHREADS=4
WORKDIR /src
RUN wget -q \
https://github.com/PDAL/PDAL/releases/download/${PDAL_VERSION}/PDAL-${PDAL_VERSION}-src.tar.gz && \
tar xfz PDAL-${PDAL_VERSION}-src.tar.gz && \
cd /src/PDAL-${PDAL_VERSION}-src && \
mkdir build && \
cd build && \
cmake .. \
-G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_MAKE_PROGRAM=make \
-DBUILD_PLUGIN_PYTHON=ON \
-DBUILD_PLUGIN_CPD=OFF \
-DBUILD_PLUGIN_GREYHOUND=ON \
-DBUILD_PLUGIN_HEXBIN=ON \
-DHEXER_INCLUDE_DIR=/usr/include/ \
-DBUILD_PLUGIN_NITF=OFF \
-DBUILD_PLUGIN_ICEBRIDGE=ON \
-DBUILD_PLUGIN_PGPOINTCLOUD=ON \
-DBUILD_PGPOINTCLOUD_TESTS=OFF \
-DBUILD_PLUGIN_SQLITE=ON \
-DWITH_LASZIP=ON \
-DWITH_LAZPERF=ON \
-DWITH_TESTS=ON && \
make -j $NUMTHREADS && \
make install
# copy grass gis source
WORKDIR /src
COPY . /src/grass_build/
WORKDIR /src/grass_build
# Set environmental variables for GRASS GIS compilation, without debug symbols
# Set gcc/g++ environmental variables for GRASS GIS compilation, without debug symbols
ENV MYCFLAGS "-O2 -std=gnu99 -m64"
ENV MYLDFLAGS "-s"
# CXX stuff:
ENV LD_LIBRARY_PATH "/usr/local/lib"
ENV LDFLAGS "$MYLDFLAGS"
ENV CFLAGS "$MYCFLAGS"
ENV CXXFLAGS "$MYCXXFLAGS"
# Configure compile and install GRASS GIS
ENV GRASS_PYTHON=/usr/bin/python3
ENV NUMTHREADS=4
RUN make distclean || echo "nothing to clean"
RUN /src/grass_build/configure \
--with-cxx \
--enable-largefile \
--with-proj --with-proj-share=/usr/share/proj \
--with-gdal=/usr/bin/gdal-config \
--with-geos \
--with-sqlite \
--with-cairo --with-cairo-ldflags=-lfontconfig \
--with-freetype --with-freetype-includes="/usr/include/freetype2/" \
--with-fftw \
--with-postgres=yes --with-postgres-includes="/usr/include/postgresql" \
--with-netcdf \
--with-zstd \
--with-bzlib \
--with-pdal \
--without-mysql \
--without-odbc \
--without-openmp \
--without-ffmpeg \
--without-opengl \
&& make -j $NUMTHREADS \
&& make install && ldconfig
# Unset environmental variables to avoid later compilation issues
ENV INTEL ""
ENV MYCFLAGS ""
ENV MYLDFLAGS ""
ENV MYCXXFLAGS ""
ENV LD_LIBRARY_PATH ""
ENV LDFLAGS ""
ENV CFLAGS ""
ENV CXXFLAGS ""
# 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
# Create generic GRASS GIS binary name regardless of version number
RUN ln -sf `find /usr/local/bin -name "grass??" | sort | tail -n 1` /usr/local/bin/grass
RUN ln -sf `find /usr/local -type d -name "grass??" | sort | tail -n 1` /usr/local/grass
# show GRASS GIS, PROJ, GDAL etc versions
RUN grass --tmp-location EPSG:4326 --exec g.version -rge && \
pdal --version && \
python3 --version
# Reduce the image size
RUN apt-get autoremove -y
RUN apt-get clean -y
WORKDIR /scripts
# install external GRASS GIS session Python API
RUN pip3 install grass-session
# install GRASS GIS extensions
RUN grass --tmp-location EPSG:4326 --exec g.extension extension=r.in.pdal
# add GRASS GIS envs for python usage
ENV GISBASE "/usr/local/grass/"
ENV GRASSBIN "/usr/local/bin/grass"
ENV PYTHONPATH "${PYTHONPATH}:$GISBASE/etc/python/"
ENV LD_LIBRARY_PATH "$LD_LIBRARY_PATH:$GISBASE/lib"
WORKDIR /tmp
COPY docker/testdata/simple.laz .
WORKDIR /scripts
COPY docker/testdata/test_grass_session.py .
## just scan the LAZ file
RUN /usr/bin/python3 /scripts/test_grass_session.py
WORKDIR /grassdb
VOLUME /grassdb
# Docker GRASS GIS (Debian Linux)
Dockerfile with an [Debian Linux](https://www.debian.org/) image with [GRASS GIS](https://grass.osgeo.org/), [PDAL](https://pdal.io) support and [grass-session](https://github.com/zarch/grass-session/).
Download size of this image is of approximately 2.6 GB.
Clone this repository and change directory:
```bash
$ git clone https://github.com/OSGeo/grass.git
$ cd grass
```
__Build the docker with__:
```bash
$ docker build \
--file docker/debian/Dockerfile_debian_pdal \
--tag grass-py3-pdal:latest-debian .
```
View the images available using `sudo docker images` and open a bash terminal with:
```bash
$ docker run -it grass-py3-pdal:latest-debian /bin/bash
bash-5.0#
```
__To build a stable version__:
change to the releasebranch or tag you want to build:
```bash
$ git checkout remotes/origin/releasebranch_7_8
```
and build and enter with:
```bash
$ docker build \
-f docker/debian/Dockerfile_debian_pdal \
-t grass-py3-pdal:stable-debian .
$ docker run -it grass-py3-pdal:stable-debian /bin/bash
bash-5.0#
```
Data source: https://github.com/PDAL/PDAL/tree/master/test/data/laz/
# Import GRASS Python bindings
from grass_session import Session
import grass.script as grass
with Session(gisdb="/grassdata/", location="test", mapset="PERMANENT", create_opts='EPSG:25832'):
print("Tests for PROJ, GDAL, PDAL, GRASS")
# simple test: just scan the LAZ file
grass.run_command('r.in.pdal', input="/tmp/simple.laz", output='count_1', method='n', flags="s", resolution=1, overwrite=True)