Vaclav (Vashek) Petras

NCSU GeoForAll Lab at the Center for Geospatial Analytics
North Carolina State University

DOI, Open GIS Group, Apr 25, 2019

Vaclav (Vashek) Petras

  • BS & MS in Geoinformatics, Czech Technical University in Prague
  • PhD in Geospatial Analytics, NC State
  • Postdoctoral Researcher at NC State
  • GRASS GIS Development Team Member
  • GRASS GIS Project Steering Committee Member
  • Open Source Geospatial Foundation Charter Member

The Beginning of GRASS GIS

  • 1980-1982: Ideas, predecessors and prototypes
  • 1983: First reference manual published
  • 1985: Geographic Resources Analysis Support System 1.0 released

The 80s of GRASS GIS

William Shatner introducing GRASS
in a historical promotional video

see full 15 min video at

GRASS GIS Timeline (cont.)

  • 90s a general purpose GIS from a land management system
  • 1999 international team of developers + GNU GPL
  • 2008 OSGeo Project
  • 2018 35 years of GRASS GIS development
  • 2019 latest release Mar 24, 2019 (7.6.1)
  • check out last change (probably just few hours ago)


Community Shares Improvements

  • GRASS GIS community provides software to the public
  • Shares its source code
  • Includes latest additions

Scientific Foundation

  • references to papers associated with modules
  • references to related scientific papers

Links to source code

Documentation now links to relevant parts of the source code.

by Luca Delucchi

Return of Investment

Learn once, use forever.

  • Emphasis on backwards compatibility
  • No increasing license fees over time
  • Employer-independent and contractor-independent

Return of Investment

Code from 2002 running in 2019?

version 5.0 code works as is in 7.6:
r.mapcalc depr.bin="if((elev - fill)< 0., 1, 0)"

although there is a better way to write it:

r.mapcalc "depr_bin = if((elev - fill) < 0., 1, 0)"


GRASS covers many fields.

  • All matured tools available right away
  • Download of experimental tools possible
  • Hydrology, remote sensing, lidar, network analysis, …


Functionality is divided into modules (over 500)

Prefix Functionality Example
r. raster processing r.mapcalc: raster map algebra
v. vector processing interpolation from points
g. general management g.remove: removes maps
d. display and rendering d.rast: display raster map
There is more: i., t., r3., m., ps.

Vector Network Analysis

  • shortest path, traveling salesman, ...
  • centrality measures, connected components, ...
  • turn cost in network nodes

Cost Surface Calculations

Travel cost as travel time


Here applied in total viewshed computation by Anna Petrasova


r.geomorphon - landform detection

by Jarek Jasiewicz and Tomek Stepinski

Solar Radiation

r.sun - new parallelized version

by Stanislav Zubal and Michal Lacko

Vector Topology Cleaning

  • introduced in 2002
  • continuous improvements

(actual data processed and displayed in GRASS GIS)

Temporal Framework

Manage and analyze spatio-temporal datasets (time series)

by Sören Gebbert and Thomas Leppelt
(visualization tools by Anna Petrasova and Luca Delucchi)

Animation Tool

Visualize spatio-temporal datasets and other series

by Anna Petrasova

Temporal Algebra

D = if(start_date(A) < "2005-01-01", A + B)
Sum maps from A with maps with equal time stamps from B which are temporally before Jan 1, 2005

by Thomas Leppelt and Soeren Gebbert

Computational Features & Improvements

  • Long established 64bit (since 2016 also on Microsoft Windows)
  • Large file support even on 32bit MS Windows
  • Many vector algorithms faster in version 7
  • Faster and higher compression ZSTD for rasters
  • Virtual raster mosaics ( r.buildvrt )
  • Segment library all-in-memory mode (faster modules, easier module development)

Addons and Extensions


Non-directional alternative to shaded relief

by Anna Petrasova


i.superpixels.slic - image segmentation using SLIC superpixels

by Rashad Kanavath and Markus Metz

Tools for Sentinel Data

download, import, preprocessing, cloud detection, and masking of Sentinel 2 data

by Roberta Fagandini, Martin Landa, Moritz Lennert, and Roberto Marzocchi

Point clouds with PDAL - binning of points using PDAL for LAS reading

by Anika Bettge and Vaclav Petras

Point cloud transects

v.profile.points - transects of point clouds

by Vaclav Petras


Hydrologic and hydraulic model of surface water flow

by Laurent Courty


r.pops.spread - Pest or Pathogen Spread simulation

by NC State Center for Geospatial Analytics


r.futures - set of modules for urban growth modeling

by NC State Center for Geospatial Analytics


Command Line

The baseline interface for efficiency and reproducibility

Graphical User Interface

The interface for beginners and desktop

Simple Python Editor

Create Python scripts and modules with ease

by Vaclav Petras

3D View

  • visualization and analytical visualization

reviewing UAV fligh path

Data catalog

g.gui.datacatalog - browse, manage, and reproject raster and vector maps

by Tereza Fiedlerova and Anna Petrasova

Command line prevails: 1987

Command line prevails: 2019

HPC & Cloud

  • NC State University (henry2)
  • University of Illinois Urbana-Champaign (Roger)
  • OpenEO (GRASS GIS backend)

Batch processing

grass7 /grassdata/nc_spm/work1 --exec \
    r.viewshed input=elevation output=viewshed \

by Vaclav Petras




Twitter: vaclavpetras
LinkedIn: Vaclav Petras

Bonus Content

Duality between GUI and commands

Command line (Bash):

Examples in the documentation and class instructions are usually provided as commands which can be used to fill in the GUI, write Python code, or run them directly.

3rd Party Interfaces

  • QGIS Processing Plugin
  • QGIS GRASS Plugin
  • R rgrass7 package

3rd Party Interfaces

  • Actinia – The GRASS GIS REST API
    • Used in the OpenEO GRASS GIS driver

3rd Party Interfaces

  • Tangible Landscape
    • tangible user interface to GRASS GIS and Blender
    • by NC State University, Center for Geospatial Analytics

Modules running:, r.contour, r.fill.dir, r.sim.water


  • native:
    • C (usable in C++)
    • Python
    • command line (Bash, cmd, …)
  • 3rd party:
    • R (rgrass7 package)
    • Ruby (grassgis gem)
    • Java (JGrasstools library)
  • as backend:
    • QGIS Processing (Python and R APIs)
    • PyWPS, ZOO-Project (OGC WPS)
    • Actinia (REST)
    • gvSIG JGrasstools Spatial Toolbox under development

GRASS GIS in the FOSS Ecosystem

Geospatial processing, algorithms, and workflows
Inkscape, Gimp, ImageMagic, GMT, QGIS
Graphics and refined the cartography
PostgreSQL with PostGIS
Relational database (spatial and non-spatial data storage)
R, Octave, Python, Jupyter, LibreOffice
Statistics, non-spatial data analysis
OpenLayers, Leaflet, GeoExt, Django, Flask
Web interface
PyWPS, ZOO-Project, Actinia
Processing server
MapServer, GeoServer, QGIS Server
spatial data publishing server


  • locations and mapsets
  • data management
  • projections
  • computational region

Spatial Database

Example of GRASS GIS database structure into locations (based on SRS) and further to mapsets (for organization)

Selecting Mapset

  • Selecting database, location, and mapset

Import, export, linking

  • Data need to be imported or linked (GDAL)
  • Vector and raster data can be linked
    • r.external, r.external.out
    • v.external, v.external.out
  • Export to various formats (or linking)
  • GRASS GIS native exchange format (v.pack, r.pack, v.unpack, …)

Computational Region

  • extent and resolution for raster computations