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
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 extract centroid coordinates in QGIS with Field Calculator - Tutorial

We did a simple procedure in QGIS but unknown to us that extracts the centroids of lines and polygons with Field Calculator commands inside the attribute table. The procedure is straightforward and does not involve the use of any intermediate layer.

Read More
Comment

 

Suscribe to our online newsletter

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

 

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
Comment

 

Suscribe to our online newsletter

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

 

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
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 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
8 Comments

 

Suscribe to our online newsletter

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

 

How to make a lake/reservoir volume-elevation curve with Python - Tutorial

Python is a programming language capable of performing calculations for hydrological studies and water resources evaluations. We have done a tutorial for the volume-elevation curve determination of the lake Patillas in Puerto Rico with Python and numerical / spatial libraries as Numpy and Rasterio. Finally, results were compared to the volume-elevation curve form a USGS survey. The procedure was done this time for a lake, but can be easily applied to any reservoir or water body when the bottom elevation is available as a raster file.

Read More
6 Comments

 

Suscribe to our online newsletter

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

 

How to make a wind rose with Python - Tutorial

Python is a useful tool for data analysis but also for data representation and as a graphic tool. This is an applied tutorial for the representation of a wind rose with Python from wind speed and direction stored on an Excel spreadsheet. The tutorial explores the options of the library to represent windroses as bars, boxes, polygons or contours.

Read More
8 Comments

 

Suscribe to our online newsletter

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

 

Gypsum and Anhydrite solubility calculation with Phreeqc and Python - Tutorial

Tutorial for the calculation of the solubility and thermodynamic stability of gypsum and anhydrite. The example simulates the dissolution of two minerals in a beaker at equilibrium, and the beaker is heated step-wise from 25ºC to 75ºC. Concentrations and saturation indices for the initial solution and the batch reaction are shown as Pandas dataframes and plotted as bar diagrams on a Jupyter Notebook. Finally a plot of the saturation index for anhydrite and gypsum with temperature is generated from an iteration over the batch reaction steps.

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 display anticlines / synclines in QGIS - Tutorial

There are three essential things for the representation of geological data on QGIS: the spatial geological information, an appropriate symbology and the software knowledge. Once these three things are available, the potential of QGIS to represent geological maps is unlimited.

We have done a tutorial for the representation of synclines, anticlines, overturned synclines and overturned anticlines on the regional scale with 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.

 

Seawater speciation modeling with Phreeqc coupled with Python and Pandas - Tutorial

The speciation modeling allows to calculate the distribution of aqueous species in a solution. Phreeqc is capable to simulate this speciation calculation and we are going to demonstrate this capability on a study case of aqueous species in seawater.

We have done a tutorial for the speciation modeling of seawater with Phreeqc that runs under Python in a Jupyter Lab enviroment. The code can run the Phreeqc executable, define the databases and stablish the output files. Results from simulation are available as Pandas dataframes and plots are made for the main components and the distribution of saturation indices.

Read More
Comment

 

Suscribe to our online newsletter

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

 

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.

 

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
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 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 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.

 

Geospatial triangular interpolation with Python, Scipy, Geopandas and Rasterio - Tutorial

Under the concept of “applied geospatial Python” we have developed some procedures / tutorials of some common spatial analysis tasks done on desktop GIS software. The aim isn’t to reinvent the wheel but to explore the current Python tools and libraries that can create, analyze and represent both vector and raster spatial data.

Triangular interpolation is one of several types of interpolation techniques available in both Python and GIS software, however the advantage of working with Python is that the interpolation is a function where you can get the interpolated value on a specific point while in GIS software you are required to create a raster and sample values from the raster (.. as far as we know).

We have created a tutorial with a complete procedure in Python to import points with elevation as a attribute, creates a triangular interpolation function and has two spatial outputs: an interpolated geospatial raster in TIFF format and a shapefile with elevation attribute for another set of points. The tutorial uses several Python libraries as Matplotlib, Rasterio, Geopandas, Scipy.

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.

 

Hatarichem v2, the online tool to create Piper, Schoeller and Stiff Diagrams

We present our own webapp for the representation of the Piper Diagram, Stiff Diagram and Scholler Diagram. The webapp was developed in Python Django and it is entirely free for everyone. The main objective behind this webapp was to develop a user friendly and minimum requirement tool to create these water quality / hidrogeochemical diagrams. The video tutorial shows the complete procedure to update the working file and then generate the diagrams.

Read More

 

Suscribe to our online newsletter

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

 

Basic example of hydrological modeling at basin scale with HEC HMS 4.5

HEC HMS is a software developed by the US Corps of Engineers that implements a series of hydrological methods to represent different physical process of the water cycle. The tools and options of HEC HMS make it a very versatile and powerful software for the hydrological simulation of different escenarios as extreme events on arid regions, or water balances in wet climates.

This tutorial shows the complete procedure to set up and simulate the hydraulic response of a 8 hour storms over a 20 hour period, model results are intended to show maximum flows and flow development with time. The area of study is a andean basin that was divided on two sub-basins (high and low part), each one has their own storm precipitation data. The model consider the use of hydrological components as subbasin, reaches and sinks.

Read More

 

Suscribe to our online newsletter

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

 

How to make a Piper Diagram in Python - Tutorial

A Piper Diagram is an effective graphic procedure to segregate relevant analytical data to understand the sources of the dissolved constituents in water. This procedure was born under the statement that most natural waters contain cations and anions in chemical equilibrium. It is assumed that the most abundant cations are calcium (Ca), magnesium (Mg) and sodium (Na). The most common anions are bicarbonate (HCO3), sulphate (SO4) and chloride (Cl).

The Piper diagram can be made by free and commercial desktop software, however in this tutorial we have generated the Python scripts and working procedure to create a Piper Diagram from values stored in a working spreadsheet.

Read More

 

Suscribe to our online newsletter

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

 

Dynamic Flood Simulation of Combined Peak Flows with HEC-RAS - Tutorial

Flood events come from periods of high precipitiation and favourable soil moisture conditions. Based on the basin topography, land cover and precipitation distribution, flood events can be conceptualized as the cummulative sum of a series of peak flows from different affluent rivers.

Flood management involve the prediction of river water elevation and velocitiy from extreme precipitation events. This tutorial shows the procedure to build a unsteady (dynamic) flow simulation of two peak flows with different hydrograms. The channel network configuration for the area of study consists of one main river and a affluent river. Peak flow in the main river is 10 hours ahead of the peak flow in the affluent river.

Read More

 

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 boxplot to represent basin scale water constituents using Python - Tutorial

Python is an interpreted high-level programming language which allows performing several statistical procedures. This programming language is an excellent option to create box plots because of its simplicity and exceptional results. This tutorial explains how to download and use Python´s Jupyter Notebook to analyze water quality data in the form of boxplots.

Box plots show the distribution of a sample using the lower quartile (Q1), the median (m or Q2) and the upper quartile (Q3)--and the interquartile range (IQR = Q3-Q1), which covers the central 50% of the data. Quartiles are values that divide the data in quarters; the term refers to the value that falls in the line that divides each quarter. Therefore, Q1 is the highest value of the first 25% of the data, Q2 is the one of the 50% of the data and Q3, the one for the 75% of the data. Characterizing the data with quartiles is advantageous because they are insensitive to outliers and preserve information about the center and spread (Krzywinski & Altman 2014).

Read More

 

Suscribe to our online newsletter

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