PyQGIS: Dissolve Vector Features with Python and QGIS
|

PyQGIS: Dissolve Vector Features with Python and QGIS

The QGIS Python API (PyQGIS) makes it really simple automate a feature dissolve. PyQGIS gives access to all the QGIS processing tools directly from the Python interface. This tutorial will demonstrate three different dissolve examples with Python in QGIS. Basic Dissolve with Python First, lets dissolve polygon features into a single polygon, this is the…

|

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…