Posts with the [Quick Coding Tip] tag are thought for giving a quick solution to simple PyQGIS tasks. If you already know How to load a layer in QGIS using Python, you may run the following code: for getting the extent of a vector or raster layer. Instead, using this code: you will get the […]Read more "[Quick Coding Tip] How to get the extent from a vector or raster layer in QGIS using Python"
This task is based on my answer to this question poped up on gis.stackexchange.com. Starting from a raster layer, the goal for this task is to split it in several tiles for further processing. We can do this task by directly using QGIS, or even with Python (GDAL). More in detail, we want to split a 5×5 […]Read more "How to split a raster in several tiles using QGIS or Python (GDAL)"
In this task we will see how to generate a vector grid of regularly spaced points. The Processing algorithm Regular points does the same thing, but we want to do it using Python. We assume to start from a layer that is already loaded in QGIS (if not, please see here) because we need to […]Read more "How to generate regularly spaced points in QGIS using Python"
In this task we will see how to load a layer in QGIS and add it to the map. All the operation are similar for both raster and vector layers. The first operation is to select the Python Console from the Plugins menu: Then, if you have to load a Vector layer: If you have to load a […]Read more "How to load a layer in QGIS using Python"