% License: CC0
% The license is CC0 but you can acknowledge the authors if you want to. See their names below.

\documentclass[innermargin=10mm]{tikzposter}
\usepackage{enumitem}
\geometry{paperwidth=197cm,paperheight=100cm}
\usepackage{url}

\usepackage{alltt}

\newcommand{\inst}[1]{\hspace{2pt}$^{\mbox{\normalsize#1}}$\hspace{-7pt}}
\newcommand{\instlist}[1]{\hspace{1pt}$^{#1}$}

\title{
  \begin{minipage}{\textwidth}
    \centering
    Analyzing rasters, vectors and time series using new Python interfaces in GRASS GIS 7
    \bigskip
  \end{minipage}
}
\author{
V\'{a}clav Petr\'{a}\v{s}\inst{1},
Anna Petr\'{a}\v{s}ov\'{a}\inst{1},
Yann Chemin\inst{2},
Pietro Zambelli\inst{3},
Martin Landa\inst{4},
S\"{o}ren Gebbert\inst{5},
Markus Neteler\inst{6}, and
Peter L\"{o}we\inst{7}
}
\institute{
\large
\instlist{1}North Carolina State University, Raleigh, USA (wenzeslaus@gmail.com, vpetras@ncsu.edu),
\instlist{2}International Water Management Institute, Pelawatta, Sri Lanka,
\instlist{3}EURAC Research, Institute for Renewable Energy, Bolzano/Bozen, Italy,
\instlist{4}Faculty of Civil Engineering, Czech Technical University in Prague, Czech Republic,
\instlist{5}Th\"{u}nen Institute of Climate-Smart Agriculture, Braunschweig, Germany,
\instlist{6}Research and Innovation Centre, Fondazione Edmund Mach, San Michele all'Adige, Italy,
\instlist{7}TIB Hannover - German National Library of Science and Technology, Hanover, Germany
}
% \titlegraphic{}

\pdfinfo{
   /Author (Vaclav Petras, Anna Petrasova, Yann Chemin, Pietro Zambelli, Martin Landa, Soeren Gebbert, Markus Neteler, and Peter Loewe)
   /Title  (Analyzing rasters, vectors and time series using new Python interfaces in GRASS GIS 7)
%    /Subject (ensuring reproducibility of scientific geospatial computing - this is from testing poster)
   /Keywords (GIS, API, algorithms, open science, reproducibility)
}

\definecolor{textcolor}{HTML}{000000}

\definecolor{titleTextColor}{HTML}{2E652E}


\definecolorpalette{sampleColorPalette} {
  \definecolor{colorOne}{HTML}{419041}
  % \definecolor{colorTwo}{HTML}{cccccc}
  \definecolor{colorTwo}{HTML}{dddddd}
  \definecolor{colorThree}{HTML}{F1B52D}
  % \definecolor{colorThree}{HTML}{EFA126}
}


\usetheme{Rays}
\usecolorstyle[colorPalette=sampleColorPalette]{Britain}
\useblockstyle{Default} % Basic
% \usecolorpalette{e}

\newlength{\logowidth}

\makeatletter
\renewcommand\TP@maketitle{%
    \begin{minipage}{0.12\linewidth}
       \centering

       \setlength{\logowidth}{0.17\textwidth}
       \newcommand{\logovspace}{\vspace{3ex}}
       \newcommand{\logohspace}{\hspace{1ex}}

       \includegraphics[width=1.6\logowidth]{ncstate}
       \logohspace
       \includegraphics[width=\logowidth]{iwmi}

       \logovspace
       \includegraphics[width=2\logowidth]{ti}
       \logohspace
       \includegraphics[width=1.2\logowidth]{ctu_prague}
       \logohspace
       \includegraphics[width=2\logowidth]{eurac}

       \logovspace

       \includegraphics[width=1.5\logowidth]{fem_cri}
       \logohspace
       \includegraphics[width=3\logowidth]{tib}
    \end{minipage}%
    \hfill
   \begin{minipage}{0.74\linewidth}
        \centering
        \color{titlefgcolor}
        {\textcolor{titleTextColor}{\textsf{\textbf{{\fontsize{85}{60}\selectfont \@title}}}}  \par}
        \vspace*{1em}
        {\huge \@author \par}
        \vspace*{1em}
        {\LARGE \@institute}
    \end{minipage}%
    \hfill
    \begin{minipage}{0.12\linewidth}
       \centering
       \includegraphics[width=0.35\textwidth]{grass}\\
       \Large \textbf{\textsf{GRASS GIS}}
    \end{minipage}
}
\setlength{\TP@visibletextwidth}{\textwidth-3\TP@innermargin}
\setlength{\TP@visibletextheight}{\textheight-3\TP@innermargin}

\makeatother

\setlength{\parskip}{1ex}

\graphicspath{{images/}{logos/}{qrcodes/}{listings/}}

% listings package does not work well with the tikzposter class,
% so we need to include PDFs with code generated separately

\newcommand{\partitle}[1]{\bigskip \textbf{#1}\\[1ex]}
\newcommand{\parinlinetitle}[1]{\bigskip \textbf{#1}\ }
\newcommand{\textfontsize}{\LARGE}
\newcommand{\blocktitlewrap}[1]{\textsf{\textbf{\LARGE#1}}}
% it is not possible (?) to change block title in the class, using wrapper
% the command introduced using:
%   sed -i 's/\\block{\([^}]*\)}/\\block{\\blocktitlewrap{\1}}/g' main.tex

% GRASS module
\newcommand{\gmodule}[1]{\emph{#1}}

\newcommand{\rafun}[1]{\texttt{#1()}}

% GRASS Python package
\newcommand{\pkg}[1]{\emph{#1}}

\begin{document}
\maketitle[width=0.95\textwidth]



\begin{columns}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\column{0.25}

% Abstract from http://meetingorganizer.copernicus.org/EGU2015/EGU2015-8142.pdf
%
% GRASS GIS 7 is a free and open source GIS software developed and used by many scientists (Neteler et al., 2012).
% While some users of GRASS GIS prefer its graphical user interface, significant part of the scientific community
% takes advantage of various scripting and programing interfaces offered by GRASS GIS to develop new models and
% algorithms. Here we will present different interfaces added to GRASS GIS 7 and available in Python, a popular
% programming language and environment in geosciences. These Python interfaces are designed to satisfy the needs
% of scientists and programmers under various circumstances.
% 
% PyGRASS (Zambelli et al., 2013) is a new object-oriented interface to GRASS GIS modules and libraries.
% The GRASS GIS libraries are implemented in C to ensure maximum performance and the PyGRASS interface
% provides an intuitive, pythonic access to their functionality. GRASS GIS Python scripting library is another way of
% accessing GRASS GIS modules. It combines the simplicity of Bash and the efficiency of the Python syntax. When
% full access to all low-level and advanced functions and structures from GRASS GIS library is required, Python
% programmers can use an interface based on the Python ctypes package. Ctypes interface provides complete, direct
% access to all functionality as it would be available to C programmers.
%
% GRASS GIS provides specialized Python library for managing and analyzing spatio-temporal data (Gebbert and
% Pebesma, 2014). The temporal library introduces space time datasets representing time series of raster, 3D raster
% or vector maps and allows users to combine various spatio-temporal operations including queries, aggregation,
% sampling or the analysis of spatio-temporal topology.
% 
% We will also discuss the advantages of implementing scientific algorithm as a GRASS GIS module and we will
% show how to write such module in Python. To facilitate the development of the module, GRASS GIS provides
% a Python library for testing (Petras and Gebbert, 2014) which helps researchers to ensure the robustness of the
% algorithm, correctness of the results in edge cases as well as the detection of changes in results due to new
% development. For all modules GRASS GIS automatically creates standardized command line and graphical user
% interfaces and documentation. Finally, we will show how GRASS GIS can be used together with powerful Python
% tools such as the NumPy package and the IPython Notebook.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\block{\blocktitlewrap{Highlights}}{
% \setlength{\parskip}{1em}
\textfontsize
% \begin{itemize}
\renewcommand{\item}{\par\vspace{0.9ex}}
\item GRASS GIS \cite{Neteler2012} is a platform for geospatial computations.
% \item GRASS GIS used directly using Python or GUI or through other software.
\item The functionality is divided into a set of modules (individual tools, functions, algorithms or models).
\item Core libraries and algorithms implemented in C for high performance.
\item Both the modules and the libraries are accessible through the Python API.
\item Specialized Python APIs support different use cases ranging from high level scripting to fine data editing.
\item It is simple to build graphical user interface.
\item NumPy or IPython can be used together with GRASS GIS Python APIs.
% \item The system together with the broad community ensures long term preservation of algorithms.
% \item GRASS GIS ecosystem supports code maintenance.
% \end{itemize}
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\block{\blocktitlewrap{Automatic creation of GUI and CLI}}{

The \gmodule{g.parser} module provides full interface definition support for Python scripts
including creation of standardized part of a help page and command line checking.
Each script which uses the GRASS GIS parser can
publish definition of its parameters (options and flags) in XML.
The GRASS GIS graphical user interface is able to use the XML
to dynamically generate an interactive graphical dialog with unified styling. 

\bigskip

\includegraphics[width=\linewidth, clip, trim=0 0 0 0]{grass_module}

\includegraphics[width=0.5\linewidth, clip, trim=0 0 0 0]{grass_module_gui}
~
\includegraphics[width=0.5\linewidth, clip, trim=0 0 0 0]{grass_module_cli}

}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\column{0.25}


\block{\blocktitlewrap{GRASS Scripting Library interface to GRASS GIS modules}}{

The \pkg{grass.script} package offers simple and straightforward syntax to call GRASS GIS modules:

\includegraphics[width=\linewidth, clip, trim=0 0 0 0]{script_doc_syntax}

}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\block{\blocktitlewrap{PyGRASS interface to GRASS GIS modules}}{

The \pkg{grass.pygrass} package provides a object-oriented way to work with GRASS GIS modules and their parameters:

\includegraphics[width=\linewidth, clip, trim=0 0 0 0]{pygrass_doc_syntax}

Additionally, the \pkg{grass.pygrass} package offers simpler, Python oriented, way of accessing modules:

\includegraphics[width=\linewidth, clip, trim=0 0 0 0]{pygrass_doc_sc_syntax}

}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\block{\blocktitlewrap{Using documentation for GRASS GIS modules}}{

Documentation of GRASS GIS modules usually use Bash syntax to provide an example of usage, e.g.:

\begin{alltt}
r.neighbors input=elevation output=elevation\_smooth method=median -c
\end{alltt}

This syntax can be easily rewritten to the \pkg{grass.script} syntax or the \pkg{grass.pygrass} syntax shown above.

% This can be easily rewritten to \pkg{grass.script} syntax:
% 
% \includegraphics[width=\linewidth, clip, trim=0 0 0 0]{script_doc_syntax}
% 
% The same applies to \pkg{grass.script} syntax:
% 
% \includegraphics[width=\linewidth, clip, trim=0 0 0 0]{pygrass_doc_syntax}
% 
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\block{\blocktitlewrap{IPython Notebook}}{

IPython Notebook is a web-based tool to develop, document, and execute code, as well as communicate the results.
In combination with GRASS GIS, it is an excellent tool to process and visualize your geospatial data,
integrate formulas, explanatory text and maps, and interact with remote servers and clusters.

\bigskip
%\includegraphics[width=0.5\linewidth, clip, trim=0 0 0 0]{pygrass_ipython_cli}
\centering
\includegraphics[width=0.95\linewidth, clip, trim=0 145 0 0]{ipython_nb}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\column{0.25}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\block{\blocktitlewrap{PyGRASS interface to C libraries}}{
Examples of using the API to convert a raster map to a NumPy array and back to raster:

\includegraphics[width=\linewidth, clip, trim=0 8 0 0]{pygrass_raster_examples}

In addition to PyGRASS interface, advanced programmers can use \pkg{ctypes} interface
to access C functions from GRASS GIS libraries directly.
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\block{\blocktitlewrap{Testing the algorithms}}{
% To facilitate the development of the module, GRASS GIS provides
% a Python library for testing (Petras and Gebbert, 2014)
% which helps researchers to ensure the robustness of the
% algorithm, correctness of the results in edge cases
% as well as the detection of changes in results due to new
% development.

To show that all promised functionality is available and algorithm works as expected
every module should be supplied with a test.
This also ensures that functionality
can be simply tested any time in the future \cite{Petras2014}.

\includegraphics[width=\linewidth, clip, trim=0 8 0 0]{gunittest}

% Tests can be written to check the numerical results but also general functionality
% such as if different parameters are accepted.
Tests can use standardize datasets or use custom reference data.
It is very easy to write a sophisticated test just by checking a statistical summary of computation results.
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\block{\blocktitlewrap{GRASS GIS modules, addons and Python scripts}}{
A Python script can by turned into a GRASS GIS module by adding a definition of the interface
using GRASS GIS parser mechanism.
Another difference is that GRASS GIS modules expect to be executed in GRASS GIS session.
Python scripts which are using GRASS GIS can be written in a way that GRASS GIS session is not required;
the setup of a necessary environment is done in the script itself in this case.
% running code from IDE

The GRASS GIS Addon repository contains modules from wide range of contributors
and ensures vendor-independent long-term preservation of the code
and ensures an easy distribution of module to individual users.
Well maintained modules in Addons can be moved to GRASS GIS core.
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\block{\blocktitlewrap{Alternatives to Python}}{
GRASS GIS API is not limited only to Python.
GRASS GIS modules are command line tools, so they can be used in shell scripting (e.g. Bash)
and as subprocesses in virtually any language as long as the proper environment is set.
The GRASS GIS library provides a C API which is commonly used to create GRASS GIS modules in C and C++ programming languages.
Finally, GRASS GIS modules can be used within R statistical environment using the \pkg{rgrass7} package.
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\column{0.25}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\block{\blocktitlewrap{GRASS GIS Temporal Framework}}{
The GRASS GIS Temporal Framework implements the temporal GIS functionality
and provides a Python API to implement spatio-temporal processing modules.
The framework introduces space-time datasets that represent time series of raster,
3D raster or vector maps.
An API example:
\includegraphics[width=1\linewidth, clip, trim=0 0 0 0]{tgrass_examples}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\block{\blocktitlewrap{References and Acknowledgements}}{

\newcommand{\blocksectiontitle}[1]{\bigskip\textbf{\textcolor{gray}{\textsf{#1}}}}

% disable the title
\renewcommand{\section}[2]{}
\begin{thebibliography}{9}

\bibitem{Neteler2012}
  Neteler, M., Bowman, M. H., Landa, M., Metz, M., 2012.
  \emph{GRASS GIS: A multi-purpose open source GIS.}
  Environmental Modelling \& Software, 31, 124--130.

\bibitem{Gebbert2014}
  Gebbert, S., Pebesma, E., 2014. A temporal GIS for field based environmental modeling. Environmental
  Modelling \& Software 53, 1--12.

\bibitem{Petras2014}
  Petras, V., Gebbert, S., 2014. Testing framework for GRASS GIS: ensuring reproducibility of scientific
  geospatial computing. Poster presented at: AGU Fall Meeting, December 15-19, 2014, San Francisco, USA.

\bibitem{Zambelli2013}
  Zambelli, P., Gebbert, S., Ciolli, M., 2013. Pygrass: An Object Oriented Python Application Programming
  Interface (API) for Geographic Resources Analysis Support System (GRASS) Geographic Information System
  (GIS). ISPRS International Journal of Geo-Information 2, 201--219.

\end{thebibliography}

\blocksectiontitle{Acknowledgements}

\newcommand{\listhspace}{\hspace{0.005\linewidth}}
\newcommand{\listlogowidth}{0.15\linewidth}
\newcommand{\listtextwidth}{0.82\linewidth}

\begin{minipage}{\listlogowidth}
\includegraphics[width=\linewidth]{osgeo}
\end{minipage}
\listhspace
\begin{minipage}{\listtextwidth}
GRASS GIS is a OSGeo project. OSGeo provides infrastructure for project
websites, mailing lists and source code management.
\end{minipage}

\bigskip

\begin{minipage}{\listlogowidth}
\includegraphics[width=\linewidth]{google}
\end{minipage}
\listhspace
\begin{minipage}{\listtextwidth}
Initial development of \pkg{pygrass} and \pkg{gunittest} packages was done during Google Summer of Code 2012 and 2014.
\end{minipage}

\bigskip

Luca Delucchi, Italy, contributed significantly to development of Python interfaces for GRASS GIS 7
through extensive testing in early stages of development, documenting the APIs
and general contributions to the code itself.

\blocksectiontitle{More information}

\newcommand{\qrcodewidth}{1\linewidth}
\hspace{-0.02\linewidth}
\begin{tabular}{lll}
\begin{minipage}{0.1\linewidth}
\includegraphics[height=\qrcodewidth]{grass_osgeo_org}
\end{minipage}
\begin{minipage}{0.27\linewidth}
GRASS GIS website\newline
% http://grass.osgeo.org/
\url{grass.osgeo.org}
\end{minipage}
&
\begin{minipage}{0.1\linewidth}
\includegraphics[height=\qrcodewidth]{python_doc}
\end{minipage}
\begin{minipage}{0.45\linewidth}
GRASS GIS Python libraries documentation\newline
% http://grass.osgeo.org/grass71/manuals/libpython/
\url{grass.osgeo.org/grass71/manuals}
\end{minipage}

\end{tabular}

% qrcode -t EPS -o grass-user.eps "http://lists.osgeo.org/listinfo/grass-user"
% epstopdf grass-user.eps
% rm grass-user.eps

}

\end{columns}
\end{document}
