QGIS Model Designer offers powerful functionality for automating workflows. Many workflows are based on conditional logic that can generate different outputs based on the inputs provided. This post shows how to setup a QGIS model that can skip certain steps if those optional inputs are not provided. This is achieved using the Conditional branch algorithm in the QGIS Model Designer.

Here’s the example workflow we want to implement

  • Given a buildings layer and a boundary layer, create a layer with building polygons at least 50m away from the boundary. This will be the final output if no other inputs are provided.
  • Optionally, if a roads layer has been provided, further process the data and create a layer with buildings polygons that are both 50m away from the boundary and within 25m of a road segment.

The key is to use an expression that checks if the roads input is NULL and selects the appropriate branch of the model to process. Below is the diagram showing the final model.

We will go through the step-by-step process of building this model. You will find a link to download a GeoPackage file containing the final model and the sample dataset at the end of the post.

Continue reading

When exporting large rasters from Google Earth Engine, it is recommended that you split your exports into several smaller tiles. In this post, I will share the best practices for creating tiled exports in your target projection that can be mosaicked together without any pixel gaps or overlaps. They key concept is the use of the crsTransform to ensure that each individual tile is on the same pixel grid.

Continue reading

Welcome to #PythonDatavizChallenge – Learn Mapping and Data Visualization with Python in 30 Days! We have designed this challenge to help you learn how to create charts, maps, animations, dashboards and interactive mapping applications using Python ! Spend 30 minutes each day for the next 30 days to level-up your Python dataviz skills. We have spent over 2 years building and refining this course and are excited to share it with you all – completely free.

We will be posting short videos everyday and cover the full course material step by step. The material covers both static and dynamic plotting libraries along with the app framework – Streamlit. At the end of the course, you will have the necessary skills to build data-powered web mapping apps and dashboards. Ready for #PythonDatavizChallenge? Read on to know the details.

This is an intermediate course that assumes good working knowledge of Python. If you are new to programming, complete our Python Foundation for Spatial Analysis course first.

Continue reading

Geo for Good is Google’s annual summit that brings together users of Google mapping tools. It’s usually a large conference hosted at Google HQ in Mountain View, California. This year however, they decided to split the conference into 2 mini summits – one in São Paulo, Brazil and another in Dublin, Ireland. I have been going to Geo for Good for many years and was glad to take part in the Geo for Good 2024 Mini Summit at Dublin. The summit was a 4-day long event that took place from Sept 23-26, 2024 at the Google Dublin office.

The Conference

Geo for Good started as way for the geospatial community to come together and celebrate social and environmental impact using Google’s mapping tools. The conference has now evolved into an Earth Engine focused event for both the Earth Engine community (research, education, non-profit) and Commercial users (Google Cloud customers).

Geo for Good Dublin Summit Participants (Photo by Alan Rowlette for Google)

I saw the following main themes in this year’s conference:

  • Theme 1: EUDR and Sustainable Sourcing of Commodities
  • Theme 2: Earth Engine as a Google Cloud Service
  • Theme 3: Machine Learning and AI
Continue reading

The QGIS International User Conference 2024 happened in Bratislava, Slovakia from 9-10 September 2024, followed by the Contributor Meeting from 11-13 September 2024. This is one of my favorite events of the year and I have been to the previous conferences in 2023 and 2019 as well. The conference keeps getting bigger and this year it attracted a diverse audience of 240 participants from around the globe. This was also my first time attending the contributor meeting and got to spend an extended time with the developers and the community.

Conference Group Photo
Continue reading

Welcome to #PyQGISChallenge – Master QGIS Python Development in 30 Days! We are launching our PyQGIS Masterclass course on YouTube and have designed this challenge to help you learn how to customize QGIS using Python with scripts, custom algorithms, actions and plugins! Spend 30 minutes each day for the next 30 days to level-up your QGIS skills. This course is the result of my 15+ years of experience doing QGIS development – including building enterprise-grade plugins and deploying QGIS to thousands of users. I am really excited to share this content with you – completely free.

We will be posting short videos everyday and cover the full course material step by step. The material is designed to help you slowly ramp up and learn complex concepts! All you have to do is show up everyday and spend half an hour watching the videos and practicing the exercises. At the end, you can take up a mini-project and apply your newly acquired skills. Ready for #PyQGISChallenge? Read on to know the details.

This is an advanced course that assumes good working knowledge of both Python and QGIS. If you are new to programming, complete our Python Foundation for Spatial Analysis course first.

Continue reading

A temporally consistent global multi-class time-series classification dataset is critical to understand and quantify long-term changes. Till now, the choices were limited to lower resolution datasets such as MODIS Landcover (2000-present) at 500m resolution or ESA CCI (1992-present) at 300m resolution. We now have a new dataset GLC_FCS30D that provides a high-resolution landcover time-series derived from the Landsat archive (1984-2022) at 30m resolution with 35 classes. This is a very valuable dataset for studying landscape dynamics at high resolution and the first of its kind to be available made available in the public domain. The source dataset was released on Zenodo and can be downloaded as GeoTIFF files. This data is also available in the Google Earth Engine Community catalog and can be used within GEE directly. In this post, I want to share some technical details and scripts to help you analyze this data using Google Earth Engine. You will learn

  • How to access and pre-process the GLC_FCS30D dataset.
  • How to visualize and compare landcover changes between 1985-2022.
  • How to calculate landcover statistics and export a CSV with areas of each class for the entire time series over multiple regions.
Continue reading

Welcome to #30DaysOfQGIS! We have launched our Advanced QGIS course on YouTube and have designed this challenge to help you master QGIS! Spend 30 minutes each day for the next 30 days to level-up your QGIS skills. This course is the result of my 15+ years of experience using QGIS for large-scale spatial analysis and automating workflows. I am really excited to share this content with you – completely free.

The material is full of tips, tricks and challenges that will make your learning journey fun and rewarding! All you have to do is show up everyday and spend half an hour watching the videos and practicing the exercise. Ready for #30DaysOfQGIS? Read on to know the details.

Continue reading

When automating GIS workflows, one often needs to automate the creation of cartographic outputs. The QGIS Model Designer allows you to build a workflow by combining multiple Processing algorithms. QGIS now includes several algorithms under the Cartography category that allow you to integrate the map creation process within your model. In this post, we will explore the Export print layout as image (or Export print layout as PDF) algorithm to automate the creation of a fire map. We will build a model that will automatically

  • Download the latest shapefile of active fires from FIRMS.
  • Extract fires intersecting the continental US.
  • Style the layer using a pre-configured QGIS style file.
  • Render a pre-configured Print Layout.

Whenever the model is run, it will output a map such as shown below.

Continue reading

When working with raster datasets of different projections and resolutions, it is often desirable to reproject them to the same projection and align them to the same pixel grid. In this post, we will explore the recently introduced options in the open-source GDAL utility gdalwarp that makes this process much simpler and efficient. In particular, we will be exploring the -r sum (Resample with Sum), -r average (Resample with Average) and -tap (Target Aligned Pixels).

We will take the following 3 raster datasets and clip, resample and align them to a common pixel grid.

  • LandScan Global: A high-quality global population grid that is available at 1km resolution in the geographic CRS WGS84 Lat/Lon (EPSG:4326).
  • GHS Population Grid: A 100m resolution global population dataset that is distributed in the World Mollweide Equal Area Projection (ESRI:54009).
  • NLCD Tree Canopy Cover: A 30m resolution gridded dataset with percent canopy estimate of tree cover in the NAD83 CONUS Alberts Projection (EPSG:5070).

As you can see we have datasets that have widely varying pixel sizes and projections. If we wanted to compare them with each other – we must first harmonize them on a unified pixel grid. We will learn how to reproject, resample and align these to the NAD83 California Albers Projection (EPSG:3311) and at 1km resolution.

Continue reading