Merge Multiple Rasters in QGIS (Create a Raster Mosaic)

Merge Multiple Rasters in QGIS (Create a Raster Mosaic)

With GIS analysis it’s a common occurrence that multiple raster tiles are required to cover a study area. For many analyses, and specifically hydrological analyses, a seamless, single raster is needed. The solution for combining multiple raster layers is to perform a raster merge, also referred to as a raster mosaic. QGIS uses the the…

Zonal Statistics Algorithm with Python in 4 Steps
| | |

Zonal Statistics Algorithm with Python in 4 Steps

It is a common need to summarize information from a gridded dataset within an irregularly shaped area. While at first glance this may seem simple, reconciling differences between raster (gridded) and vector (polygon) datatypes can quickly become complicated. This article shows how to implement a zonal statistics algorithm in Python in 4 steps. Load raster…

Python: Geographic Object-Based Image Analysis (GeOBIA) – Part 2: Image Classification
| | | |

Python: Geographic Object-Based Image Analysis (GeOBIA) – Part 2: Image Classification

Use the random forests algorithm to classify image segments into land cover categories. This post is a continuation of Geographic Object-Based Image Analysis (GeOBIA). Herein, we use data describing land cover types to train and test the accuracy of a random forests classifier. Land cover data were created in the previous post. Step-be-step video instructions…

|

PyQGIS: Shapefile from Selected Features

A common operation with vector layers is to select features based on attribute values and save those features to a new vector layer (i.e. shapefile). This tutorial will walk you through how to create a new shapefile from selected features. We’ll select some features, then save those features to a new shapefile. First, we’ll open…

|

PyQGIS: Create Raster

In a previous tutorial I showed you how to access raster values and data with the Geospatial Data Abstraction Library (GDAL). This tutorial will show you how to create a raster with GDAL. Start by importing the gdal and osr Python modules. The osr module is used for handling spatial references. Also import numpy. Now…

|

PyQGIS: Loading and symbolizing raster layers

More information can be found in the PyQGIS Developer Cookbook. Requirements QGIS version 3.0, or greater Objectives Load and symbolize a raster layer with pyqgis Get statistics from a raster band Open the QGIS Python Console From the menu, select Plugins -> Python Console, or Ctrl + Alt + P (Windows) You can type directly into…