{"id":13880,"date":"2023-09-05T10:04:25","date_gmt":"2023-09-05T08:04:25","guid":{"rendered":"https:\/\/www.opengis.ch\/?p=13880"},"modified":"2023-09-13T22:17:25","modified_gmt":"2023-09-13T20:17:25","slug":"analyzing-and-visualizing-large-scale-fire-events-using-qgis-processing-with-st-dbscan","status":"publish","type":"post","link":"https:\/\/www.opengis.ch\/it\/2023\/09\/05\/analyzing-and-visualizing-large-scale-fire-events-using-qgis-processing-with-st-dbscan\/","title":{"rendered":"Analyzing and visualizing large-scale fire events using QGIS processing with ST-DBSCAN"},"content":{"rendered":"\n<p>A while back, one of our ninjas added a <strong>new algorithm in QGIS<\/strong>\u2019 processing toolbox named ST-DBSCAN Clustering, short for <strong>spatio temporal density-based spatial clustering of applications with noise<\/strong>. The algorithm regroups features falling within a user-defined maximum distance and time duration values.<\/p>\n\n\n\n<p>This post will walk you through one practical use for the algorithm: large-scale fire event analysis and visualization through remote-sensed fire detection. More specifically, we will be looking into one of the larger fire events which occurred in Canada\u2019s Quebec province in June 2023.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"645\" src=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/fires_cover.png?resize=750%2C645&#038;ssl=1\" alt=\"\" class=\"wp-image-13888\" srcset=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/fires_cover.png?w=1021&amp;ssl=1 1021w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/fires_cover.png?resize=300%2C258&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/fires_cover.png?resize=768%2C660&amp;ssl=1 768w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Fetching and preparing FIRMS data<\/h2>\n\n\n\n<p>NASA\u2019s <a href=\"https:\/\/firms.modaps.eosdis.nasa.gov\/\">Fire Information for Resource Management System (<strong>FIRMS<\/strong>)<\/a> offers a fantastic worldwide archive of all fire detected through three spaceborne sources: MODIS C6.1 with a resolution of roughly 1 kilometer as well as VIIRS S-NPP and VIIRS NOAA-20 with a resolution of 375 meters. Each detected fire is represented by a point that sits at the center of the source\u2019s resolution grid.<\/p>\n\n\n\n<p>Each source will cover the whole world several times per day. Since detection is impacted by atmospheric conditions, a given pass by one source might not be able to register an ongoing fire event. It\u2019s therefore advisable to rely on more than one source.<\/p>\n\n\n\n<p>To look into our fire event, we have chosen the two fire detection sources with higher resolution &#8211; VIIRS S-NPP and VIIRS NOAA-20 \u2013 covering the whole month of June 2023. The datasets were downloaded from <a href=\"https:\/\/firms.modaps.eosdis.nasa.gov\/download\/\">FIRMS\u2019 archive download page<\/a>.<\/p>\n\n\n\n<p>After downloading the two separate datasets, we combined them into one merged geopackage dataset using QGIS processing toolbox\u2019s <strong>Merge Vector Layers algorithm<\/strong>. The merged dataset will be used to conduct the <strong>clustering analysis<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"619\" height=\"520\" src=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/merge.png?resize=619%2C520&#038;ssl=1\" alt=\"\" class=\"wp-image-13881\" srcset=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/merge.png?w=619&amp;ssl=1 619w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/merge.png?resize=300%2C252&amp;ssl=1 300w\" sizes=\"auto, (max-width: 619px) 100vw, 619px\" \/><\/figure>\n<\/div>\n\n\n<p>In addition, we will use QGIS\u2019s field calculator to create a new Date &amp; Time field named ACQ_DATE_TIME using the following expression:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>to_datetime(\"ACQ_DATE\" || \"ACQ_TIME\", 'yyyy-MM-ddhhmm')<\/code><\/code><\/pre>\n\n\n\n<p>This will allow us to calculate precise time differences between two dates.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"674\" src=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/fieldcalculator.png?resize=750%2C674&#038;ssl=1\" alt=\"\" class=\"wp-image-13882\" srcset=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/fieldcalculator.png?w=786&amp;ssl=1 786w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/fieldcalculator.png?resize=300%2C269&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/fieldcalculator.png?resize=768%2C690&amp;ssl=1 768w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Modeling and running the analysis<\/h2>\n\n\n\n<p>The large-scale fire event analysis requires running two distinct algorithms:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a <strong>spatiotemporal clustering of points<\/strong> to regroup fires into a series of events confined in space and time; and<\/li>\n\n\n\n<li>an <strong>aggregation of the points within the identified clusters<\/strong> to provide additional information such as the beginning and end date of regrouped events.<\/li>\n<\/ul>\n\n\n\n<p>This can be achieved through QGIS\u2019 modeler to sequentially execute the <a href=\"https:\/\/docs.qgis.org\/3.28\/en\/docs\/user_manual\/processing_algs\/qgis\/vectoranalysis.html#st-dbscan-clustering\">ST-DBSCAN Clustering algorithm<\/a> as well as the <a href=\"https:\/\/docs.qgis.org\/3.28\/en\/docs\/user_manual\/processing_algs\/qgis\/vectorgeometry.html#aggregate\">Aggregate algorithm<\/a> against the output of the first algorithm.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"629\" height=\"745\" src=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/model.png?resize=629%2C745&#038;ssl=1\" alt=\"\" class=\"wp-image-13883\" srcset=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/model.png?w=629&amp;ssl=1 629w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/model.png?resize=253%2C300&amp;ssl=1 253w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><\/figure>\n<\/div>\n\n\n<p>The above-pictured model outputs two datasets. The first dataset contains single-part points of detected fires with attributes from the original VIIRS products as well as a pair of new attributes: the CLUSTER_ID provides a unique cluster identifier for each point, and the CLUSTER_SIZE represents the sum of points forming each unique cluster. The second dataset contains multi-part points clusters representing fire events with four attributes: CLUSTER_ID and CLUSTER_SIZE which were discussed above as well as DATE_START and DATE_END to identify the beginning and end time of a fire event.<\/p>\n\n\n\n<p>In our specific example, we will run the model using the merged dataset we created above as the \u201cfire points layer\u201d and select ACQ_DATE_TIME as the \u201cdate field\u201d. The outputs will be saved as separate layers within a geopackage file.<\/p>\n\n\n\n<p><em>Note that the maximum distance (0.025 degrees) and duration (72 hours) settings to form clusters have been set in the model itself. This can be tweaked by editing the model.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Visualizing a specific fire event progression on a map<\/h2>\n\n\n\n<p>Once the model has provided its outputs, we are ready to start <strong>visualizing a fire event on a map<\/strong>. In this practical example, we will focus on detected fires around latitude 53.0960 and longitude -75.3395.<\/p>\n\n\n\n<p>Using the multi-part points dataset, we can identify two clustered events (CLUSTER_ID 109 and 1285) within the month of June 2023. To help map canvas refresh responsiveness, we can filter both of our output layers to only show features with those two cluster identifiers using the following SQL syntax: CLUSTER_ID IN (109, 1285).<\/p>\n\n\n\n<p>To show the <strong>progression of the fire event over time<\/strong>, we can use a data-defined property to graduate the marker fill of the single-part points dataset along a color ramp. To do so, open the layer\u2019s styling panel, select the simple marker symbol layer, click on the data-defined property button next to the fill color and pick the Assistant menu item.<\/p>\n\n\n\n<p>In the assistant panel, set the source expression to the following: <code>day(age(to_date('2023-07-01'),\u201dACQ_DATE_TIME\u201d))<\/code>. This will give us the number of days between a given point and an arbitrary reference date (2023-07-01 here). Set the values range from 0 to 30 and pick a color ramp of your choice.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"631\" height=\"661\" src=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/styling.png?resize=631%2C661&#038;ssl=1\" alt=\"\" class=\"wp-image-13884\" srcset=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/styling.png?w=631&amp;ssl=1 631w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/styling.png?resize=286%2C300&amp;ssl=1 286w\" sizes=\"auto, (max-width: 631px) 100vw, 631px\" \/><\/figure>\n<\/div>\n\n\n<p>When applying this style, the resulting map will provide a visual representation of the spread of the fire event over time.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"562\" src=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/96.png?resize=750%2C562&#038;ssl=1\" alt=\"\" class=\"wp-image-13885\" srcset=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/96.png?w=755&amp;ssl=1 755w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/96.png?resize=300%2C225&amp;ssl=1 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><figcaption class=\"wp-element-caption\">Having identified a fire event via clustering easily allows for identification of the \u201cstarting point\u201d of a fire by searching for the earliest fire detected amongst the thousands of points. This crucial bit of analysis can help better understand the cause of the fire, and alongside the color grading of neighboring points, its directionality as it expanded over time.<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Analyzing a fire event through histogram<\/h2>\n\n\n\n<p>Through <a href=\"https:\/\/github.com\/ghtmtt\/DataPlotly#readme\">QGIS\u2019 DataPlotly plugin<\/a>, it is possible to <strong>create an histogram of fire events<\/strong>. After installing the plugin, we can open the DataPlotly panel and configure our histogram.<\/p>\n\n\n\n<p>Set the plot type to histogram and pick the model\u2019s single-part points dataset as the layer to gather data from. Make sure that the layer has been filtered to only show a single fire event. Then, set the X field to the following layer attribute: &#8220;ACQ_DATE&#8221;.<\/p>\n\n\n\n<p>You can then hit the Create Plot button, go grab a coffee, and enjoy the resulting histogram which will appear after a minute or so.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"726\" height=\"572\" src=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/dataplotly.png?resize=726%2C572&#038;ssl=1\" alt=\"\" class=\"wp-image-13886\" srcset=\"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/dataplotly.png?w=726&amp;ssl=1 726w, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/dataplotly.png?resize=300%2C236&amp;ssl=1 300w\" sizes=\"auto, (max-width: 726px) 100vw, 726px\" \/><\/figure>\n<\/div>\n\n\n<p>While not perfect, an histogram can quickly provide a good sense of a fire event\u2019s \u201cpeak\u201d over a period of time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A while back, one of our ninjas added a new algorithm in QGIS\u2019 processing toolbox named ST-DBSCAN Clustering, short for spatio temporal density-based spatial clustering of applications with noise. The algorithm regroups features falling within a user-defined maximum distance and time duration values. This post will walk you through one [&hellip;]<\/p>\n","protected":false},"author":34,"featured_media":13885,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_themeisle_gutenberg_block_has_review":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6,15,161],"tags":[203,204,125],"class_list":["post-13880","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gis","category-qgis","category-uncategorised","tag-fires","tag-firms","tag-qgis-org"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2023\/09\/96.png?fit=755%2C566&ssl=1","jetpack-related-posts":[{"id":3911,"url":"https:\/\/www.opengis.ch\/it\/2018\/05\/28\/how-to-filter-features-in-qgis-using-the-graphical-processing-modeler\/","url_meta":{"origin":13880,"position":0},"title":"How to filter features in QGIS using the graphical processing modeler","author":"Matthias Kuhn","date":"28 Maggio 2018","format":false,"excerpt":"This article describes a new algorithm for the processing modeler called feature filter algorithm. If you are already familiar with ETL concepts and the graphical modeler, you can directly jump to the section the feature filter algorithm. Building workflows for repetitive tasks When building workflows for simple or complex geodata\u2026","rel":"","context":"In &quot;Expressions&quot;","block_context":{"text":"Expressions","link":"https:\/\/www.opengis.ch\/it\/category\/programming\/expressions\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2018\/05\/modeller.png?fit=1016%2C497&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2018\/05\/modeller.png?fit=1016%2C497&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2018\/05\/modeller.png?fit=1016%2C497&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2018\/05\/modeller.png?fit=1016%2C497&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":2021,"url":"https:\/\/www.opengis.ch\/it\/2016\/02\/04\/increasing-the-stability-of-processing-algorithms\/","url_meta":{"origin":13880,"position":1},"title":"Increasing the stability of processing algorithms","author":"Matthias Kuhn","date":"4 Febbraio 2016","format":false,"excerpt":"Processing just got a new testing framework to improve\u00a0the long-term stability of this important plugin. And you can help to improve it, even if you are not a software developer! This is yet another piece in our never-stopping crusade to improve the stability and quality of the best\u00a0desktop GIS on\u2026","rel":"","context":"In &quot;C++&quot;","block_context":{"text":"C++","link":"https:\/\/www.opengis.ch\/it\/category\/programming\/cpp\/"},"img":{"alt_text":"pr","src":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2016\/02\/pr.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2016\/02\/pr.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2016\/02\/pr.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2016\/02\/pr.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":15627,"url":"https:\/\/www.opengis.ch\/it\/2025\/06\/02\/xlsform-converter-unlock-a-world-of-surveys-with-our-brand-new-qgis-plugin\/","url_meta":{"origin":13880,"position":2},"title":"XLSForm Converter: unlock a world of surveys with our brand new QGIS plugin","author":"Mathieu","date":"2 Giugno 2025","format":false,"excerpt":"Easily bring your XLSForm surveys into the QGIS and QField ecosystem. The plugin converts spreadsheets into fully prepared QGIS projects\u2014with media support, automatic form configuration, and one-click upload to QFieldCloud. Migrating to QField was never easier!","rel":"","context":"In &quot;Processing&quot;","block_context":{"text":"Processing","link":"https:\/\/www.opengis.ch\/it\/category\/gis\/qgis\/processing\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2025\/05\/xlsformconverter-qgis-qfield.webp?fit=1098%2C859&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2025\/05\/xlsformconverter-qgis-qfield.webp?fit=1098%2C859&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2025\/05\/xlsformconverter-qgis-qfield.webp?fit=1098%2C859&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2025\/05\/xlsformconverter-qgis-qfield.webp?fit=1098%2C859&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2025\/05\/xlsformconverter-qgis-qfield.webp?fit=1098%2C859&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":9703,"url":"https:\/\/www.opengis.ch\/it\/2019\/12\/03\/qgis-on-the-road-episode-1\/","url_meta":{"origin":13880,"position":3},"title":"QGIS on the Road: Episode I &#8211; The GIS Awakens","author":"Marco Bernasocchi","date":"3 Dicembre 2019","format":false,"excerpt":"This summer we went on tour with what turned out to be an extremely popular event: QGIS on the Road Telling the most remarkable story of Maya the beekeeper building her honey business and fighting against seemingly hopeless challenges with the help of QGIS functionality you probably never heard of.\u2026","rel":"","context":"In &quot;QGIS on the road&quot;","block_context":{"text":"QGIS on the road","link":"https:\/\/www.opengis.ch\/it\/category\/events\/qgis-on-the-road\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2019\/12\/episode_01.png?fit=1200%2C676&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2019\/12\/episode_01.png?fit=1200%2C676&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2019\/12\/episode_01.png?fit=1200%2C676&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2019\/12\/episode_01.png?fit=1200%2C676&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2019\/12\/episode_01.png?fit=1200%2C676&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":14290,"url":"https:\/\/www.opengis.ch\/it\/2024\/05\/13\/qgis-dxf-export-enhancements\/","url_meta":{"origin":13880,"position":4},"title":"QGIS DXF Export enhancements","author":"Germ\u00e1n Carrillo","date":"13 Maggio 2024","format":false,"excerpt":"At OPENGIS.CH, we've been working lately on improving the DXF Export QGIS functionality for the upcoming release 3.38. In the meantime, we've also added nice UX enhancements for making it easier and much more powerful to use! Let's see a short review. DXF Export app dialog and processing algorithm harmonized\u2026","rel":"","context":"In &quot;QGIS&quot;","block_context":{"text":"QGIS","link":"https:\/\/www.opengis.ch\/it\/category\/gis\/qgis\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/04\/DXF_Override_output_name_poster_image.jpg?fit=1200%2C899&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/04\/DXF_Override_output_name_poster_image.jpg?fit=1200%2C899&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/04\/DXF_Override_output_name_poster_image.jpg?fit=1200%2C899&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/04\/DXF_Override_output_name_poster_image.jpg?fit=1200%2C899&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2024\/04\/DXF_Override_output_name_poster_image.jpg?fit=1200%2C899&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3624,"url":"https:\/\/www.opengis.ch\/it\/2018\/06\/22\/threads-in-pyqgis3\/","url_meta":{"origin":13880,"position":5},"title":"Using Threads in PyQGIS3","author":"Marco Bernasocchi","date":"22 Giugno 2018","format":false,"excerpt":"While porting a plugin to QGIS3 I decided to also move all it's threading infrastructure to QgsTasks. Here three possible variants to implement this.the first uses the static method QgsTask.fromFunction and is simpler to use. A great quick solution. If you want need control you can look at the second\u2026","rel":"","context":"In &quot;PyQt&quot;","block_context":{"text":"PyQt","link":"https:\/\/www.opengis.ch\/it\/category\/programming\/python\/pyqt\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2018\/06\/pexels-wendy-van-zyl-1212179-scaled.jpg?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2018\/06\/pexels-wendy-van-zyl-1212179-scaled.jpg?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2018\/06\/pexels-wendy-van-zyl-1212179-scaled.jpg?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2018\/06\/pexels-wendy-van-zyl-1212179-scaled.jpg?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2018\/06\/pexels-wendy-van-zyl-1212179-scaled.jpg?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_shortlink":"https:\/\/wp.me\/pbdBtI-3BS","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/posts\/13880","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/comments?post=13880"}],"version-history":[{"count":4,"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/posts\/13880\/revisions"}],"predecessor-version":[{"id":13896,"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/posts\/13880\/revisions\/13896"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/media\/13885"}],"wp:attachment":[{"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/media?parent=13880"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/categories?post=13880"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/tags?post=13880"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}