Since, I have been saving the generated files in scratch layers whenever they are intermediate products, of auxiliary nature to the process I am running. This way, they are automatically deleted, and I don’t have to worry about them after executing my code. So, I decided to summarize how I save PyQGIS tool outputs in scratch layers, in case this is useful to someone out there!
This error is especially common when you are re-running a code you have already ran in the past. Sometimes, as I am coding, I run an incomplete version of my code, just to know if the compiler/interpreter accuses any errors. The codes frequently include open and saving items. I thought that the mentioned file would be overwritten every time I ran a file saving in the QGIS Python Console.
ERROR 1: Attempt to write non-multipoint (POINT) geometry to multipoint shapefile. ERROR 1: Unable to write feature 0 from layer points_layer. ERROR 1: Terminating translation prematurely after failed translation of layer points_layer (use -skipfailures to skip errors)
In this post, I show how to perform this process using two different tools, one of them is native of QGIS, and the other is a plugin available on the plugin repository. Then, I comment on how to sample the original raster using an interpolation such as cubic, cubic spline, or bilinear for the sampled value.
First, I will create a purposefully invalid geometry to apply the fix. Then, I will show you two ways to fix it. In one of them, I simply apply the “Fix geometries” native tool of QGIS. The second option I will show here is using the buffer tool. In this simple trick, I will show you how to create an infinitesimal buffer around my broken geometry, which ends up fixing it, but has its perks as well.
The first thing I thought when I saw the “Interpolated Line” symbology (I described this functionality in another post) was that it would be useful to represent drainage networks. Today, that is what we are exploring. Innovative ways to represent your river network to depict the watershed in an even more elegant and informative way, using the “Interpolated Line” functionality.
This week, I am showing you how to create custom geometries to enhance your legends on QGIS Print Layout. Specifically, how to create these geometries based on vector files that you already have. The example I will provide is how to create the Legend Patch Shape for the state of Rio Grande do Sul, in Brazil.
I use pygrib to open the files. In their documentation, they point to two ways to install pygrib, using pip or using conda. However, I could only make it work using conda. Run this in your Anaconda Prompt to install pygrib.
This week, I am discussing an error which used to be a warning on the old rasterio - and I ignored it. Lesson learned! I was doing my usual savings of GeoTIFF rasters in an updated python environment (with rasterio 1.2.6) when I saw this error:
The good news is that using Leaflet Truesize plugin, you can add your own customized draggable polygons to the map. A map that I thought almost immediately is the representation of the draggable Brazilian states, so you could compare them to each other and to the size of other countries. And that is why this is used as an example for this tutorial.