How to reproject single and multiple rasters with Python and Rasterio - Tutorial

Raster reprojection is a common task on GIS analysis however to do it with only Python commands has some challenges. We have done an applied example of raster reprojection for single and multiple rasters from WGS 84 UTM to WGS 84 Geographic. The codes work on monoband and multiband rasters and can reproject from to any projection by specifiyin it EPSG code.

The tutorial is done on a conda enviroment that has the geospatial libraries installed. You can set up the environment by following this tutorial:

https://hatarilabs.com/ih-en/how-to-install-python-geospatial-libraries-gdal-fiona-rasterio-etc-under-a-conda-env-in-windows

Read More

Tutorial to do a tutorial in open source software for water resources

Let's have a look at the tutorial concept in its real dimension. A tutorial is a period of instruction that provides practical information about a specific topic. The tutorial can be given by an individual or institution and has a goal to teach you something or master you in something you didn't know before.

However in water resources software, we don’t see the tutorial as a part of the documentation or a key part of the learning experience. The tutorial is in fact an essential part needed to understand the whole capabilities of the software in practical exercises. It´s true that most software delivery exercises of different applied cases, but we can’t say they are tutorial in fact because those exercises lack a perspective of guided work.

Read More

Effective stress calculation from MODFLOW Groundwater Flow Model with Model Muse & Flopy - Tutorial

Effective stress theory was developed by Terzaghi in the 1920s. Based on our modeling experience we wanted to calculate the effective stress based on the results from a MODFLOW groundwater model. Finally, after 6 years from the first thought about it we came with a full deduction of the effective stress calculation based on the model geometry and an applied example for the effective stress calculation on a hillslope groundwater flow model.

The example model was developed in Modflow-Nwt and Model Muse, whereas the effective stress determination was done with scripts in Python and Hataripy (our fork of Flopy). The scripts can also generate 3D objects as VTK files of the model results, geometry and stresses that can be visualized in Paraview.

Read More

How to change your career to hydrogeology… with appropriate success

We are not a talent agency, we are not even a job portal;however, as other topics on this blog, we post based on requests from our followers. We don’t want to conceptualize the definition of a job or a career, but let’s have a common agreement that a successful career in geosciences is an occupation that provides a level of satisfaction, covers some basic necessities and keeps you motivated to know more.

If your idea of success is to manage a big group of people, we might suggest you evaluate the construction or the retail industry; if you want approval and being recognized for your work you can start your own blog or become a Youtuber.

Read More

Which are the limitations of online learning for hydroinformatics?

Based on our experience in online learning for water resources based on open source that dates way before the Covid pandemia, we have seen some limitations of elearning as a framework to teach software for water resources.

Even though we can conceptualize elearning as something new, it is in fact a poor performance copy of the classroom environment on the computer. We simulate the whiteboard (we prefer chalkboard, less allergic), the teacher, the interventions, the assignments, the exams and everything else that is related to the normal classroom, even breaks and graduations. But this “Second Life” version of education has its limitations that have to be well assessed in order to define strategies to achieve the objective of education: bring new and better capabilities to water resources professionals.

Read More

How to manage psychological stress of hydrogeologists / numerical modelers?

Over the time, we have seen numerical modeling as a great tool for the evaluation of the groundwater flow regime and we might have seen numerical modelers as high level professionals with strong analytical capabilities that can provide all the answers we need to proof that a project is sustainable or the accuracy of a predictive simulation. On a broad perspective we might have overestimated the numerical modeling exercise and sometimes deified numerical modelers, but by sure we haven’t seen them as humans.

Read More

How to insert and read Observation Points (OBS6) in Modflow 6 with Model Muse and Flopy - Tutorial

Modflow 6 has a new approach in setting up observation points and it's essentially different to the previous versions. The OBS6 package works not only with heads and drawdowns but also with flows, so it's also possible to calibrate the model against baseflow or any other recorded flow from a boundary condition directly. We have created an applied case of the implementation of piezometers in a hillslope groundwater flow model in Modflow 6 and Model Muse. The tutorial covers all the steps related to the implementation of the observed points in Model Muse as well as the comparison among simulated and observed heads through scripts in Flopy.

Read More

How to install the Python geological modeling library Gempy in Windows with Debian and WSL

Gempy is an open-source library for modeling geology written in Python. The library is capable of creating complex 3D geological models including structures, fault networks, and unconformities and it can be coupled with uncertainty analysis.

Due to the required packages and specific configuration the installation of Gempy is a challenge on Windows, we have developed an alternative installation process by the use of a Debian kernel under a Windows Subsystem for Linux. This tutorial shows the complete procedure to install Gempy from the Debian kernel setup to the review of the Gempy in Python.

Read More

How to create a point/line/polygon shapefile with Python and Fiona - Tutorial

Storage, management and analysis of geospatial vector data as an ESRI shapefile is a common procedure of GIS and related professionals. The generation of these spatial files can be done not only on a desktop software but also by Python commands. We have created an applied example that shows the procedure in Python to create point, line, and polygon shapefiles from a csv file by the use of the Fiona library.

Read More

How to install Python geospatial libraries (Gdal, Fiona, Rasterio, etc) under a Conda Env in Windows

Python is a great tool for spatial analysis and geomachine learning, however sometimes the Windows operating system presents some difficulties to install and run the bunch of Python libraries such as Gdal, Fiona, Geopandas, Rasterio. We are aware that most geoscientists, water resources specialists and related professionals work on Windows, therefore we are always in the search of new ways to get Python working with all its geospatial capabilities in every computer. We have created a tutorial that shows the installation process of the Python geospatial libraries in Windows by the use of a Conda environment; the process is simple on its steps, however the sequence and factors related to the package compatibility are important on the installation.

Read More

A place to find MODFLOW executables for any operating system: Windows, Mac or Linux

A normal distribution of the core versions of MODFLOW as well as its variants, and Modflow-Based particle tracking and solute transport models includes not only the executables for Windows, but also the documentation, source code, test problems and other utility programs. Working with the multiple tools of Modflow implies a huge collection of files that aren’t useful for the simulation itself if you are working on Windows. Modelers working on Mac or Linux had to compile our executable by themselves.

Read More

How to install Postgresql and Postgis in Windows 10 with WSL and Debian - Tutorial


The normal method to install Postgresql and Postgis requires the set up of several binaries and the workflow is usually on graphical user interfaces (GUI). We wanted to come with a way to install Postgresql and Postgis in Windows 10 while keeping the shell experience from Linux. This tutorial shows the procedure to install the database inside a Debian application (it could be Ubuntu as well) in Windows 10 that can actually be accessible from QGIS.


The normal method to install Postgresql and Postgis requires the set up of several binaries and the workflow is usually on graphical user interfaces (GUI). We wanted to come with a way to install Postgresql and Postgis in Windows 10 while keeping the shell experience from Linux. This tutorial shows the procedure to install the database inside a Debian application (it could be Ubuntu as well) in Windows 10 that can actually be accessible from QGIS.

Read More

What we dont see in the development of open source software for groundwater modeling

Usually we dedicate much time to developing tutorials and sometimes, just a few times, we actually write an article on this blog. Lately, our aim to discover and code is much greater than our impulse to give our opinion. This post is a special case where we write something without knowing if it is written because we are motivated or because there is something that needs to be written. In any case, writing this post doesn’t make us more free or happy... “Es macht uns nicht mehr zufrieden”... because we don´t know much about some things related to human nature.

Read More

5 tutorials for crop detection and vegetation delineation with Python and QGIS

Over the last months we have researched the different tools in Python and QGIS available to recognize crops and vegetation as geospatial vector files. We have used a variety of techniques that range from machine learning algorithms with Scikit Learn and Scikit Image to just more innovative band combinations and reclassifications in QGIS. This article shows the summary of the tutorials produced so far that we are sure will be very helpful for GIS professionals and geoscientists.

Read More

Mixing groundwater and seawater geochemical modeling with Phreeqc and Python - Tutorial

Phreeqc can solve geochemical simulations for a specific solution and simulations relying on previous results. We have developed a tutorial that goes through the Example 3 from the Phreeqc documentation in a stepwise approach to simulate groundwater, seawater, the mixing from both and cases regarding the equilibrium with calcite and dolomite. There is a Python class capable of running the input files and parse results incluided on the scripting part of the input files.

Read More

A geospatial Python class for crop recognition over drone orthophoto - Tutorial

Spatial analysis and machine learning sometimes require massive coding in order to achieve decent results such as identifying plants from a drone orthophoto. We wanted to create a simple workflow for beginner and intermediate Python users to work with these libraries without much pain or frustration. This tutorial has the complete procedure to use a Python class that recognizes plants from an orthophoto based on sample points and creates intermediate plots and identifies plants as point shapefiles.

Read More

How to delineate crops from Drone Orthophotos with QGIS - Tutorial

While doing research on machine learning algorithms for drone orthophotos we found that crops can be delineated with just standard QGIS with excellent performance. Based on the addition of the blue and red band divided by the green band we can have a new vegetation index where the most healthy crops have low index values (0-1.5) and the dry crops / barren soil have high values (more than 1.9). This tutorial shows the complete procedure on QGIS to perform the delineation from bean plants on a drone orthophoto with a resolution of 5cm.

Read More