In this task, we will use python scripting for converting a Comma-Separated Values file (also known as CSV file) to a shapefile using PyQGIS. We will use a sample dataset available from SpatialKey, which contains: 36634 records in Florida for 2012 from a sample company that implemented an aggressive growth plan in 2012. We will only use […]Read more "How to convert a CSV file to a shapefile in QGIS using Python"
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 total number of features that are stored in the current vector layer. Instead, if you […]Read more "[Quick Coding Tip] How to count the features from a vector layer in QGIS using Python"
One of the most powerful QGIS tools is the possibility to create custom Python codes and then adding them to the Processing Toolbox. This operation has several advantages, for example: the creation of user-friendly dialogs for the user inputs and output files; the integration of the custom script with other tools already loaded in the […]Read more "Basic rules for writing Python scripts for Processing Toolbox in QGIS"
This task is based on my answer to this question from gis.stackexchange.com. Sometimes it happens that, when importing external files in QGIS (typically .CSV files), the fields specifying the longitude and latitude coordinates are accidentally inverted: this behavior will produce a different result in respect of the desired output. If we don’t want to repeat the same procedure, we may run a […]Read more "How to invert lon/lat coordinates in QGIS using Python"