Tutorial to convert geospatial data (Shapefile) to 3D data (VTK) with Python, Geopandas & Pyvista

In our perspective, 3D visualization of geospatial data has been a long desired feature that has been covered in some features from SAGA GIS or in some plugins from QGIS. This time we developed a Python script that converts point / line / polygon ESRI shapefiles (or any vector file) to unstructured grid Vtk format type (Vtu) by the use of the Python libraries Geopandas and Pyvista. The tutorial has files, scripts, and videos that show the whole procedure with some remarks on the software and spatial files and a discussion about the nature of the spatial files that presents some challenges in the data conversion.

Read More
1 Comment

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

How to build a Postgis geodabatase with Python and Geoalchemy (with connection to QGIS3) - Tutorial

As a peruvian slang the word “chicha” means mixture, but a mixture of a high level of heterogeneity, something like doing a pizza with all the ingredients from your refrigerator. This time we have developed a tutorial with this “chicha” spirit since it combines a database, sql language, a virtualization engine, Python, a variant of SQL Alchemy, port forwarding and connection to QGIS in Windows. Certainly, we are not code developers by nature, but we are pretty happy to have achieved this level of complexity or mixture.

We have developed an applied tutorial for the implementation of a Postgresql database with Postgis enabled on a Docker image. Information about groundwater well locations have been inserted from a CSV file with Python and Geoalchemy and Docker ports have been forwarded and open to be accessible from QGIS in Windows.

Read More
Comment

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

How to plot the azimuth and dip from a inclined bedding in QGIS 3 - Tutorial

QGIS has a wide range of options for the representation of vector data (point, line and polygon) but specific workflows have to be established to apply QGIS in different fields such as Geology. We found that there were few resources about how to plot geological features as bedding planes, faults, synclines and other and we have decided to do a series of tutorials showing those procedures on applied examples.

This time, we have developed a tutorial with the complete procedure to plot the azimuth and dip of bedding planes with QGIS. The tutorial imports a SVG marker that rotates according to a field value while the dip is presented as a label.

Read More
2 Comments

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

Are we learning software in water resources in the wrong way?

However, based on what we see we still have some doubts about the way that we are learning software in water resources, and we are concerned if the level / rate of knowledge shared will cope with the next challenges of humanity as climate change in water resources meaning droughts, floods and others or developing sustainable policies in water resources.

Read More
2 Comments

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

How to import a Esri style (.style) into QGIS with Slyr - Tutorial

Dealing with spatial data in real life implies dealing with styles for vector data and unfortunately, there we find a huge gap between commercial and open source software. There are some tool to overcome these problems as the QGIS plugin Slyr.

This time we have done a tutorial with whole procedure to change the Esri style (.style files) for geological units to a Xml file with Slyr that is applied to the polygon style in QGIS.

Read More
Comment

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

Watershed and stream network delineation on large scale basins with QGIS 3 - Tutorial

The delineation of watersheds and stream networks is one of the most fundamental steps on water resources analysis. Working with QGIS for water resources shows some challenges on the normal water resources workflow since we have to couple raster / vector datasets, coordinate system, and algorithm limitations.

We have developed a tutorial with the whole procedure to create the watershed and stream network on vector format for large scale basins in QGIS 3. Steps range from elevation datasets download for Nasa Earthdata, creating virtual rasters, lower resolution, change coordinate system, fill sinks, create channel networks, calculate upslope area, polygonize rasters and others.

Read More
Comment

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

Interactive MODFLOW MT3D transport model visualization with Flopy, Ipywidgets and Voila - Tutorial

Representation and analysis of flow and transport results is a challenge for groundwater modelers. Aspects such as speed, compatibility, data format and visualization options are key in the 2D/3D representation of head and concentration on model cells. Under the Jupyterlab framework new tools have been developed that can be useful to represent model results on a user friendly way .

This time we have done a tutorial for the interactive representation of a contaminant plume in Jupyterlab; modeling was done with Modflow Nwt and Mt3d, representation was done with Matplolib, Ipywidgets and Voila.

Read More
Comment

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

Interactive Shapefile exploration in Jupyterlab with Ipyleaflet and Voila - Tutorial

Whether you want to explore or visualize a Shapefile without leaving the Jupyterlab environment or you just want a better tool for the spatial representation this tutorial might be of your interest. We have developed an interactive application on Jupyterlab with Ipyleaflet and Voila that represent a selected shapefile on a canvas with options for basemaps, zoom and others.

Read More
2 Comments

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

How to convert a Raster to Contours with Python and GDAL - Tutorial

On the way to discover the analogy of the common desktop GIS procedures to Python we assumed that the process of extracting contours from raster was well documented or there were many tutorials on the topic. We found that there weren't many options to complete this process successfully or with few amount of pain, therefore we have done a complete tutorial on the process to create contours from a elevation raster with Python and GDAL that includes input data, scripts, and a discussion over the main steps of processing.

Read More
Comment

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

Which are the challenges for model calibration in MODFLOW 6?

MODFLOW 6 is the latest version of MODFLOW; we can’t frame this version as new because it has been released in May 2017 when QGIS 3 wasn’t even released or Python 3.6 was the latest version. On the hydrogeological perspective changes don't come as fast as expected and the amount of users of MODFLOW 6 is increasing but there are limitations on the pre/post processing tools that can take the best of the software for the general public.

Besides the philosophical discussion if a model can be “calibrated” or just “validated” there are some changes on the structure of MODFLOW 6 that bring challenges on the traditional way of model calibration.

Read More
3 Comments

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

Online Voronoi Modflow 6 groundwater modeling with Hakuchik - Tutorial

Because a new year has come with a new way to model groundwater flow using the latest developments of Modflow 6 Disv. We are not exactly sure that we have done a tutorial, or a procedure or a bunch of code and tools together but we are sure that we have done something that can model geospatial groundwater flow online with awesome 3d representations. At the time we launched all the code on the Hakuchik server, we had a feeling of "we did it" and you are entitled to see if our work is good, bad or in progress. We are sure that more development needs to be done but this will be the way of groundwater modeling in the future, hoping that improving the capacities of professionals and concern of the general population will lead to a sustainable management of our groundwater resources.

Read More
2 Comments

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

Variable density groundwater flow modeling with MODFLOW 6 and BUY package - Tutorial

Coastal aquifers and the interaction among brine / fresh groundwater need to be evaluated with a modeling code that can deal with variable density flow. For more than 18 years, SEAWAT was the prefered (or only) open source solution implemented in Modflow 2000 with some limitations* on its use with Flopy. Now in Modflow 6 the concept of simulation involves flow and transport modeling together with exchange among them. We have done a tutorial with a simple case of variable density flow from a saline lake into an acuifer. The transient model has a duration of 50 days where the saline water "intrudes" the aquifer at the bottom part of the lake.

Read More
Comment

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

Hatarilabs presents its study area for integrated and sustainable groundwater management

Because field work and numerical models are just tools for the sustainable management of our groundwater resources we have searched a study place to develop a long-term project on a high-stressed aquifer that will lead to sustainable and effective groundwater policies. The study area is an alluvial aquifer that was primarily used for agriculture production with an neighboring unplanned urban development that has increased the domestic / industrial water demand. Several pumping schemas were implemented on the area and have affected the groundwater levels and the water availability for agriculture.

Read More
Comment

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

How to geolocate drone imagery from a csv table with Python and Piexif - Tutorial

If your drone doesn´t write the GPS position on the image metadata, this is a tutorial that might be of your interest. When you have the images without any location reference and the image location on another text file you can use the code described below to generate geolocated drone imagery compatible with OpenDroneMap. The tutorial shows all the steps involved besides it has some sample data to practice.

Read More
4 Comments

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

How to create a geospatial Raster from XY data with Python, Pandas and Rasterio - Tutorial

Another tutorial done under the concept of “geospatial python”. The tutorial shows the procedure to run a Scipy interpolation over a Pandas dataframe of point related data having a 2D Numpy array as an output. With some procedures of Rasterio the Numpy array was transformed into a monoband geospatial Tiff raster.

Read More
4 Comments

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

How to join lines and densify vertices with Python, Fiona, Shapely - Tutorial

We have done a tutorial under the concept of "applied geospatial Python". This is an example that deals with a selective filtering of a determined road from a road geopackage. The selected road is composed of a group of lines that are merged into a Shapely LineString. Based on a Numpy linspace with the Shapely interpolate function, a set of points were distributed along the merged line path and later interpreted as a LineString. Resulting line was saved as a ESRI Shapefile file with Fiona.

Read More
Comment

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

Convert from Excel Spreadsheet to Point Shapefile with Python, Pandas & Fiona - Tutorial

We have done a tutorial with a workaround procedure in Python with Pandas and Fiona of a common and but multi-step process to create point shapefiles from excel spreadsheets. The process involve some lines of code to read the excel file, define the output shapefile structure and write the point data.

Read More
Comment

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

Machine Learning Supported Groundwater Model Calibration with Modflow, Flopy, PySal and Scikit Learn - Tutorial

We have done a tutorial on a low-level-complexity model with rivers, lakes, recharge and regional groundwater flow done in Model Muse in a previous tutorial. The model was imported as an object in Python with Flopy. A sensibility analysis was done with SALib to assess the response for the object model groundwater flow to a different sample of parameters and a resulting set of parameters and corresponding heads (parameters -> heads) were recorded. Then a machine learning regression was performed with Scikit-Learn with the inverse set (heads->parameters) to get the predicted parameters for the observed data. Different error measurements were performed for two model cases to assess the overall quality of the neural network regressor.

Read More
Comment

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

How to set a multiuser Jupyterlab server with Jupyterhub (in Windows with Docker)

When teaching or working with Python there is a challenge to have and work simultaneously with the same Python version and Python packages. Jupyterhub is a great solution to bring notebooks to a group of users with admin tools and many more features. We have done a tutorial to install Jupyterhub with Jupyterlab in a local lan or wifi network. The tutorial shows the procedure to run Jupyterhub from Docker in Windows, set up a native authenticator and configure an admin and users.

Read More
17 Comments

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.

 

How to do a simulated groundwater head difference map in MODFLOW and ModelMuse - Tutorial

This is a tutorial about some functionalities of Model Muse to analyze and process layer heads or parameters. The applied example was done based on a previous tutorial of a model with 3 stress periods, one static and two transient periods of 10 days. The simulated map shows the head difference in the last 10 days.

Read More
2 Comments

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.