Articles

We publish a large number of detailed technical articles on a variety of topics. You can explore them below.

QGIS

Running QGIS Processing Tools on the Command Line with qgis_process
Modern versions of QGIS comes with a handy command-line utility called qgis_process. This allows you to access and run any Processing Tool, Script or Model from the Processing Toolbox on a terminal. This is very useful for automation since it doesn't require you to …
Split Polygons into Equal Parts using QGIS
In this post, I describe how we can use built-in QGIS processing tools to create a workflow to split polygons into equal parts. Using a clever algorithm and Feature Iterator tool in the Processing Framework, we can easily split all features in a given …
Calculating Weighted Centroids
In this post, I will outline techniques for computing weighted-centroids in both QGIS and Google Earth Engine. For a polygon feature, the centroid is the geometric center. It can also be thought of as the average coordinate of all points within the polygon. There …
GIS Applications in Urban and Regional Planning
I recently taught a 1-month long course on GIS Applications in Urban and Regional Planning. We explored how GIS can be applied to solve problems in 6 different thematic areas. In this post, I will outline different applications and show concrete examples of using …
Spatial Homogeneity Testing of Raingauge Data with Advanced QGIS Expressions
Rainfall is arguably the most frequently measured hydro-meteorological variable. It is a required input for many hydrological applications like runoff computations, flood forecasting as well as engineering design of structures. However, rainfall data in its raw form contain many gaps and inconsistent values. Therefore …
Fixing Rasters with Missing Data using QGIS, GDAL and Python
When working with raster data, you may sometimes need to deal with data gaps. These could be the result of sensor malfunction, processing errors or data corruption. Below is an example of data gap (i.e. no data values) in aerial imagery. Source Image: © …
Calculating Shared Border Lengths Between Polygons
In a previous post, I showed how to use the aggregate function to find neighbor polygons using QGIS. Using aggregate functions on the same layer allows us to easily do geoprocessing operations between features of a layer. This is very useful in many analysis …
Generating Random Points with a Specific Distribution
Generating pseudo-random data is important for many aspects of research work. QGIS provides for many methods of generating random points to facilitate this. Recently, I ran into a problem where I wanted to generate random points inside a polygon – but I wanted the …
Fuzzy Table Joins in QGIS
Table Joins are a way to join 2 separate layers based on a common attribute value. QGIS has a Join Attributes By Field Value algorithm that allows you to table joins. A limitation of this algorithm is that the field values must match exactly. …
Find Neighbor Polygons using Summary Aggregate Function in QGIS
Read my previous posts Summary Aggregate and Spatial Filters and Advanced Aggregate Expressions to Automate QA to learn more about the powerful aggregate function. The aggregate function in QGIS was designed to work with 2 separate input vector layers, but we can also make …
Advanced Aggregate Expressions to Automate QA in QGIS
This post is the continuation of Summary Aggregate and Spatial Filters in QGIS. I have been exploring aggregate functions more and have found interesting ways to automate tasks in QGIS. One such example is helping automatically keeping track of feature edits to help with …
Summary Aggregate and Spatial Filters in QGIS
QGIS expression engine has a powerful a summary aggregate function that can do spatial joins on the fly. This enables some very interesting uses. One such use is to enable faster and more accurate data editing. For example, when you are digitizing a new …
Creating Animated Flight Lines in QGIS
You may have seen a map where source and destination points are connected via curved lines. It is possible to create such a map in QGIS with a simple trick – using custom projections and densification of lines. I will outline the steps to …

QGIS Aggregate Function

Summary Aggregate and Spatial Filters in QGIS
QGIS expression engine has a powerful a summary aggregate function that can do spatial joins on the fly. This enables some very interesting uses. One such use is to enable faster and more accurate data editing. For example, when you are digitizing a new …
Advanced Aggregate Expressions to Automate QA in QGIS
This post is the continuation of Summary Aggregate and Spatial Filters in QGIS. I have been exploring aggregate functions more and have found interesting ways to automate tasks in QGIS. One such example is helping automatically keeping track of feature edits to help with …
Find Neighbor Polygons using Summary Aggregate Function in QGIS
Read my previous posts Summary Aggregate and Spatial Filters and Advanced Aggregate Expressions to Automate QA to learn more about the powerful aggregate function. The aggregate function in QGIS was designed to work with 2 separate input vector layers, but we can also make …
Fuzzy Table Joins in QGIS
Table Joins are a way to join 2 separate layers based on a common attribute value. QGIS has a Join Attributes By Field Value algorithm that allows you to table joins. A limitation of this algorithm is that the field values must match exactly. …
Calculating Shared Border Lengths Between Polygons
In a previous post, I showed how to use the aggregate function to find neighbor polygons using QGIS. Using aggregate functions on the same layer allows us to easily do geoprocessing operations between features of a layer. This is very useful in many analysis …
Spatial Homogeneity Testing of Raingauge Data with Advanced QGIS Expressions
Rainfall is arguably the most frequently measured hydro-meteorological variable. It is a required input for many hydrological applications like runoff computations, flood forecasting as well as engineering design of structures. However, rainfall data in its raw form contain many gaps and inconsistent values. Therefore …

PyQGIS

Approximating Geodesic Buffers with PyQGIS
When you want to buffer features that are spread across a large area (such as global layers), there is no suitable projection that can give you accurate results. This is the classic case for needing Geodesic Buffers – where the distances are measured on …
Exporting Print Layouts from Processing Scripts
When trying to automate your GIS workflows, one important step is the production of maps. Creating and exporting maps in QGIS is done via the Print Layout. One can automate creation of maps via the a rich Python API using the QgsLayout class. It …
Snapping GPS tracks to Roads using PyQGIS and OSRM
If you have collected GPS tracks, you know that the results can have varying accuracy. The track points collected along a route are not always on the road and can be jittery. If you are a logistics, delivery or a cab company – this …
Creating Maps with Google Earth Engine and PyQGIS
Google Earth Engine (GEE) is a powerful cloud-based system for analysing massive amounts of remote sensing data. One area where Google Earth Engine shines is the ability to calculate time series of values extracted from a deep stack of imagery. While GEE is great …
K-Means Clustering with Equal Sized Clusters in QGIS
K-Means Clustering is a popular algorithm for automatically grouping points into natural clusters. QGIS comes with a Processing Toolbox algorithm 'K-means clustering' that can take a vector layer and group features into N clusters. A problem with this algorithm is that you do not …

Google Earth Engine

Automated Coastline Extraction from Satellite Images using Google Earth Engine
In this article, I will outline a method for extracting shoreline from satellite images in Google Earth Engine. This method is scalable and automatically extracts the coastline as a vector polyline. The full code link is available at the end of the post. The …
Managing Earth Engine Assets using the GEE Python API
If you are like me, you have a lot of assets uploaded to Earth Engine. As you upload more and more assets, managing this data becomes quite a cumbersome task. Earth Engine provides a handy Command-Line Tool that helps with asset management. While the …
Temporal Gap-Filling with Linear Interpolation in GEE
Many applications require replacing missing pixels in an image with an interpolated value from its temporal neighbours. This gap-filling technique is used in several applications, including: Replacing Cloudy Pixels: You may want to fill gap in an image with the best-estimated value from the …
Working with QA Bands and Bitmasks in Google Earth Engine
Most optical satellite imagery products come with one or more QA-bands that allows the user to assess quality of each pixel and extract pixels that meet their requirements. The most common application for QA-bands is to extract information about cloudy pixels and mask them. …
Calculating Weighted Centroids
In this post, I will outline techniques for computing weighted-centroids in both QGIS and Google Earth Engine. For a polygon feature, the centroid is the geometric center. It can also be thought of as the average coordinate of all points within the polygon. There …
Aggregating Gridded Population Data in Google Earth Engine
Google Earth Engine makes it easy to compute statistics on gridded raster datasets. While calculating statistics on imagery datasets is easy, special care must be taken when working with population datasets. In this post, I will outline the correct technique for computing statistics for …
Working with Gridded Rainfall Data in Google Earth Engine
Many useful climate and weather datasets come as gridded rasters. The techniques for working with them is slightly different than other remote sensing datasets. In this post, I will show how to work with gridded rainfall data in Google Earth Engine. This post also …
Histogram Matching in Google Earth Engine
Color correction is an important process working with satellite and aerial imagery. A common technique used to balance the colors across multiple images is Histogram Matching. While the algorithm has been around for a long time, there aren't many free and open-source tools that …
Calculating Area in Google Earth Engine
When working on Remote Sensing applications, many operations require calculating area. For example, one needs to calculate area covered by each class after supervised classification or find out how much area within a region is affected after a disaster. Calculating area for rasters and …
Extracting Time Series using Google Earth Engine
Time series analysis is one of the most common operations in Remote Sensing. It helps understanding and modeling of seasonal patterns as well as monitoring of land cover changes. Earth Engine is uniquely suited to allow extraction of dense time series over long periods …
Creating Maps with Google Earth Engine and PyQGIS
Google Earth Engine (GEE) is a powerful cloud-based system for analysing massive amounts of remote sensing data. One area where Google Earth Engine shines is the ability to calculate time series of values extracted from a deep stack of imagery. While GEE is great …

Python

Creating Animated Plots with Matplotlib
Matplotlib has functionality to created animations and can be used to create dynamic visualizations. In this post, I will explain the concepts and techniques for creating animated charts using Python and Matplotlib. I find this technique very helpful in creating animations showing how certain …
Fast Point-in-Polygon Analysis with GeoPandas and Uber’s H3 Spatial Index
Spatial indexing methods help speed up spatial queries. Most GIS software and databases provide a mechanism to compute and use spatial index for your data layers. QGIS as well as PostGIS use a spatial indexing scheme based on R-Tree data structure – which creates …
Fixing Rasters with Missing Data using QGIS, GDAL and Python
When working with raster data, you may sometimes need to deal with data gaps. These could be the result of sensor malfunction, processing errors or data corruption. Below is an example of data gap (i.e. no data values) in aerial imagery. Source Image: © …

GDAL/OGR

Weighted Multi-Criteria Overlay Analysis using GDAL Tools
Multi-criteria Overlay Analysis is the process of the allocation of land to suit a specific objective on the basis of a variety of attributes that the selected areas should possess. Although this is a common GIS operation, it is best performed in the raster …
Fixing Rasters with Missing Data using QGIS, GDAL and Python
When working with raster data, you may sometimes need to deal with data gaps. These could be the result of sensor malfunction, processing errors or data corruption. Below is an example of data gap (i.e. no data values) in aerial imagery. Source Image: © …
Reclassifying Rasters using gdal_calc
gdal_calc is one of the lesser used tools among the GDAL utilities. There aren't many examples of using it in the wild and some advanced features are not well documented. I am finding myself using it a lot lately and have discovered some really …
Convert between Orthometric and Ellipsoidal Elevations using GDAL
When working with elevation data, sometimes you may discover that 2 datasets from different providers have very different elevation values for the same location. A common reason for this being each dataset being referenced to a different surface. Orthometric (or geoid) elevation measures height …
Creating Geospatial PDFs with GDAL Tools
GeoPDF is a unique data format that brings the portability of PDF to geospatial data. A GeoPDF document can present raster and vector data and preserve the georeference information. This can be a useful format for non-GIS folks to consume GIS data without needing GIS-software. …
Spatial Joins on the Command Line
GDAL and OGR libraries come with handy command-line tools. These tools are quite powerful and can save you a lot of effort if you know how to use them. Here I will show how to use the ogrinfo and ogr2ogr tools to perform spatial joins. A single command can …

Mapshaper

Optimizing Office Commute with Uber Movement Data
In a previous post, I showed how to use the Uber Movement Travel Times data to create isochrones. In this post, we will explore another use case of this dataset. Say you are concerned about loss of productivity due to long commute times of …
Analyzing Urban Mobility with Uber Movement Data
Mapshaper is a free and open-source software for spatial data processing. It is written in javascript and runs in your browser without any extra plugins and can perform a range of analysis. It started out as a tool for topologically-aware simplification, but has evolved …
Geo Data Processing with Mapshaper
Mapshaper is a free and open-source tool that is best known for fast and easy simplification. Other tools for simplification – like QGIS or ogr2ogr – do not preserve topology while simplifying. This means you may get sliver polygons or missing intersections. Mapshaper performs topologically-aware …

Other

Lessons from Hosting Online Training Events
As everyone who is involved in teaching and training knows, the past few months have been hard. We all had to make changes to accommodate working from home and adopting online teaching methods. Before the COVID-19 outbreak, I used to conduct all my training …
History and Evolution of Location Intelligence Technology
I was invited to participate in a panel discussion on Geospatial Intelligence for #LetsTalkDeepTech Webcast hosted by Swiggy. I talked about the history and evolution of this space and gave a deep dive into solutions for deriving intelligence from imagery. Below is the a …
Convert between UTM and Degree coordinates using Google Spreadsheets
Converting between different coordinate reference systems or projection is a fairly standard feature in a GIS. There are a number of command line tools also available for performing bulk-conversions. cs2cs program, part of the PROJ.4 library is my favorite. Recently, someone presented me with an interesting …
Line Transact Surveys using OpenDataKit(ODK)
This weekend, I got an opportunity to volunteer with a non-profit called Junglescapes. We took a day trip to the Bandipur forest in Karnataka where they have done extensive work in forest restoration. One of their success stories is working with the locals to remove …
Implementing a Field Data collection app for APD
The Association for People with Disability (APD) is a non-profit organization based out of Bangalore, India. Their mission is to reach out and rehabilitate people with disability from the under privileged segment. Over the past year, I along with my colleagues have been volunteering with them …
Le Paper Globe
A long pending weekend project is done. Printed, cut and folded a sturdy globe using the template from Le Paper Globe. This is not only fun, but a good prop to learn more about Geography. I envision it would make a fun do-it-yourself project with …
Calculate distance between a pair of lat/lon coordinates
I recently had a need to calculate distance between a large number of latitude/longitude coordinate pairs. There are many options available if you want to import these in a GIS and run analysis. But there is a simpler and much more accesible way if …
GIS Project Ideas for Thesis/ Dissertation/ Internship
Many students have asked me for ideas on what topic they should choose for their Thesis. I have debated this myself when I was a student. The ideal topic would be the one that allows you to dive into a topic deeply as well …