[QGIS-Developer] Weekly builds for Windows not available?
At https://download.osgeo.org/qgis/windows/weekly/?C=M=D There are no weekly builds since April 8, are they shipped somewhere else now? Peter ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
[QGIS-Developer] passing parameters to QGIS Python-Script started via Command Line
Hi everyone, My goal: I want to open QGIS using the Command-Line, load a specific project, select specific features and zoom to the selected features. What sounds rather difficult is actually mostly solvable using the following: "C:\Program Files\QGIS 3.16\bin\qgis-ltr-bin.exe" -p "d:\standardebenen.qgs" --code myscript.py This opens QGIS with the Project d:\standardebenen.qgs and after that it runs the script "myscript.py". Within the scrip I can do everything what I can do in a Python-script, so there I can select some features in a layer and show that selection. But this selections are "hard-coded" in the script, I cannot pass over these parameters to the myscript.py. In "Pure Python" I can pass parameters to a Python Script using "python myscript.py arg1 arg2 arg3". This seems to be not working in the QGIS-Command-Line as the parameters are interpreted as "layers to load". Am I right with my analysis? One workaround is to write the parameters to al file and use this file within the myscript.py to define the selections. But this is very unhandy... Are there any ideas from any QGIS-Expert to solve my problem? If this cannot be solved in the current version of QGIS is one of the developers willing to get in contact with me to make an offer the implement this feature ? Thanks Peter ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [QGIS-Developer] Memory Leak / Slowdown?
Hi Matthias, they both do not work… So I will make a Ticket I think… Thanks anyway Matthias for your great support! Best greetings Peter Von: Matthias Gesendet: Montag, 20. April 2020 17:21 An: Drexel Peter ; qgis-u...@lists.osgeo.org; qgis-developer@lists.osgeo.org Betreff: Re: AW: AW: [QGIS-Developer] Memory Leak / Slowdown? Hi Peter, Happy you found a way. Can you try proposals number 2 and 3 from my previous email? If they do not help, please open a ticket. Bests Matthias 20 April 2020 17:14 Drexel Peter mailto:peter.dre...@vorarlberg.at>> wrote: Hi Matthias, Thanks to your hints I found a way: The script also works if I do not add the Layer to the Project but directly save the Sld-Style. So I can also skip clearing the QgsProject.instance. vlayer=QgsVectorLayer (pfad ,sfileOhneExt,"ogr") #QgsProject.instance().addMapLayer(vlayer) vlayer.saveSldStyle (sldpfad) #QgsProject.instance().clear() But besides my personal “success”: including the 2 Lines should not lead to rising time /memory consumption or am I wrong? Should I make a ticket? Peter Von: Matthias mailto:matth...@opengis.ch>> Gesendet: Montag, 20. April 2020 15:40 An: Drexel Peter mailto:peter.dre...@vorarlberg.at>>; qgis-u...@lists.osgeo.org<mailto:qgis-u...@lists.osgeo.org>; qgis-developer@lists.osgeo.org<mailto:qgis-developer@lists.osgeo.org> Betreff: Re: AW: [QGIS-Developer] Memory Leak / Slowdown? Hi Peter, It's possible that a part of the cleanup only happens on the next event loop run. Questions / things to try: - Do you really need to add them to the project or is a layer without adding it to the project good enough for your purpose? - Can you run this in batches of ~100 (or even 1) each and then trigger the next batch on a new event loop invocation, e.g. by using QTimer.singleShot() - The easiest thing would be calling QgsApplication.processEvents(), but be warned that using this is known for introducing instabilities, depending on the context in which it is called Matthias 20 April 2020 15:11 Drexel Peter mailto:peter.dre...@vorarlberg.at>> wrote: Hi Matthias, yes, the same with a clean new profile. 4 iterations per second at the begining, 1 very 6 seconds at the end… … QGIS-Version 3.12.1-București QGIS-Codeversion 121cc00ff0<https://github.com/qgis/QGIS/commit/121cc00ff0> Kompiliert gegen Qt 5.11.2 Laufendes Qt 5.11.2 Kompiliert mit GDAL/OGR 3.0.4 Läuft mit GDAL/OGR 3.0.4 Kompiliert mit GEOS 3.8.1-CAPI-1.13.3 Läuft mit GEOS 3.8.1-CAPI-1.13.3 Kompiliert mit SQLite 3.29.0 Läuft mit SQLite 3.29.0 PostgreSQL-Client-Version 11.5 SpatiaLite-Version 4.3.0 QWT-Version 6.1.3 QScintilla2-Version 2.10.8 Kompiliert mit PROJ 6.3.1 Läuft mit PROJ Rel. 6.3.1, February 10th, 2020 BS-Version Windows 10 (10.0) Aktive Python-Erweiterungen db_manager; MetaSearch; processing Von: Matthias Kuhn mailto:matth...@opengis.ch>> Gesendet: Montag, 20. April 2020 12:50 An: Drexel Peter mailto:peter.dre...@vorarlberg.at>>; qgis-u...@lists.osgeo.org<mailto:qgis-u...@lists.osgeo.org> Betreff: Re: [QGIS-Developer] Memory Leak / Slowdown? Hi Peter, Did you try this on a clean new profile with no plugins installed? Bests Matthias On 4/20/20 11:08 AM, Drexel Peter wrote: Hi, I use a Python-Script to load all shapefiles in a directory tree one by one and export the sld-files. It works fine, but slows down incredible after ~100 files. So I tried the following barebone script with just the essentials (load shapefile, add it to the map canvas, remove it again and then clear the project) in a loop and I get the same behavior… from datetime import datetime for i in range(1, 1000): vlayer=QgsVectorLayer ("aShapeFile.shp" ,"run " + str(i) + " at " + datetime.now().strftime('%H:%M:%S') ,"ogr") QgsProject.instance().addMapLayer(vlayer) QgsProject.instance().removeMapLayer(vlayer.id()) QgsProject.instance().clear() Same result, the Script slows down after every iteration in the loop AND QGIS-memory consumption goes up! Do I need to do some garbage cleaning / what am I doing wrong / is this a Memory leak? Thanks everybody for any hints / help! Peter ___ QGIS-Developer mailing listqgis-develo...@lists.osgeo.org<mailto:QGIS-Developer@lists.osgeo.org> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [QGIS-Developer] Memory Leak / Slowdown?
Hi Matthias, Thanks to your hints I found a way: The script also works if I do not add the Layer to the Project but directly save the Sld-Style. So I can also skip clearing the QgsProject.instance. vlayer=QgsVectorLayer (pfad ,sfileOhneExt,"ogr") #QgsProject.instance().addMapLayer(vlayer) vlayer.saveSldStyle (sldpfad) #QgsProject.instance().clear() But besides my personal “success”: including the 2 Lines should not lead to rising time /memory consumption or am I wrong? Should I make a ticket? Peter Von: Matthias Gesendet: Montag, 20. April 2020 15:40 An: Drexel Peter ; qgis-u...@lists.osgeo.org; qgis-developer@lists.osgeo.org Betreff: Re: AW: [QGIS-Developer] Memory Leak / Slowdown? Hi Peter, It's possible that a part of the cleanup only happens on the next event loop run. Questions / things to try: - Do you really need to add them to the project or is a layer without adding it to the project good enough for your purpose? - Can you run this in batches of ~100 (or even 1) each and then trigger the next batch on a new event loop invocation, e.g. by using QTimer.singleShot() - The easiest thing would be calling QgsApplication.processEvents(), but be warned that using this is known for introducing instabilities, depending on the context in which it is called Matthias 20 April 2020 15:11 Drexel Peter mailto:peter.dre...@vorarlberg.at>> wrote: Hi Matthias, yes, the same with a clean new profile. 4 iterations per second at the begining, 1 very 6 seconds at the end… … QGIS-Version 3.12.1-București QGIS-Codeversion 121cc00ff0<https://github.com/qgis/QGIS/commit/121cc00ff0> Kompiliert gegen Qt 5.11.2 Laufendes Qt 5.11.2 Kompiliert mit GDAL/OGR 3.0.4 Läuft mit GDAL/OGR 3.0.4 Kompiliert mit GEOS 3.8.1-CAPI-1.13.3 Läuft mit GEOS 3.8.1-CAPI-1.13.3 Kompiliert mit SQLite 3.29.0 Läuft mit SQLite 3.29.0 PostgreSQL-Client-Version 11.5 SpatiaLite-Version 4.3.0 QWT-Version 6.1.3 QScintilla2-Version 2.10.8 Kompiliert mit PROJ 6.3.1 Läuft mit PROJ Rel. 6.3.1, February 10th, 2020 BS-Version Windows 10 (10.0) Aktive Python-Erweiterungen db_manager; MetaSearch; processing Von: Matthias Kuhn mailto:matth...@opengis.ch>> Gesendet: Montag, 20. April 2020 12:50 An: Drexel Peter mailto:peter.dre...@vorarlberg.at>>; qgis-u...@lists.osgeo.org<mailto:qgis-u...@lists.osgeo.org> Betreff: Re: [QGIS-Developer] Memory Leak / Slowdown? Hi Peter, Did you try this on a clean new profile with no plugins installed? Bests Matthias On 4/20/20 11:08 AM, Drexel Peter wrote: Hi, I use a Python-Script to load all shapefiles in a directory tree one by one and export the sld-files. It works fine, but slows down incredible after ~100 files. So I tried the following barebone script with just the essentials (load shapefile, add it to the map canvas, remove it again and then clear the project) in a loop and I get the same behavior… from datetime import datetime for i in range(1, 1000): vlayer=QgsVectorLayer ("aShapeFile.shp" ,"run " + str(i) + " at " + datetime.now().strftime('%H:%M:%S') ,"ogr") QgsProject.instance().addMapLayer(vlayer) QgsProject.instance().removeMapLayer(vlayer.id()) QgsProject.instance().clear() Same result, the Script slows down after every iteration in the loop AND QGIS-memory consumption goes up! Do I need to do some garbage cleaning / what am I doing wrong / is this a Memory leak? Thanks everybody for any hints / help! Peter ___ QGIS-Developer mailing listqgis-develo...@lists.osgeo.org<mailto:QGIS-Developer@lists.osgeo.org> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [QGIS-Developer] Memory Leak / Slowdown?
Hi Matthias, yes, the same with a clean new profile. 4 iterations per second at the begining, 1 very 6 seconds at the end… … QGIS-Version 3.12.1-București QGIS-Codeversion 121cc00ff0<https://github.com/qgis/QGIS/commit/121cc00ff0> Kompiliert gegen Qt 5.11.2 Laufendes Qt 5.11.2 Kompiliert mit GDAL/OGR 3.0.4 Läuft mit GDAL/OGR 3.0.4 Kompiliert mit GEOS 3.8.1-CAPI-1.13.3 Läuft mit GEOS 3.8.1-CAPI-1.13.3 Kompiliert mit SQLite 3.29.0 Läuft mit SQLite 3.29.0 PostgreSQL-Client-Version 11.5 SpatiaLite-Version 4.3.0 QWT-Version 6.1.3 QScintilla2-Version 2.10.8 Kompiliert mit PROJ 6.3.1 Läuft mit PROJ Rel. 6.3.1, February 10th, 2020 BS-Version Windows 10 (10.0) Aktive Python-Erweiterungen db_manager; MetaSearch; processing Von: Matthias Kuhn Gesendet: Montag, 20. April 2020 12:50 An: Drexel Peter ; qgis-u...@lists.osgeo.org Betreff: Re: [QGIS-Developer] Memory Leak / Slowdown? Hi Peter, Did you try this on a clean new profile with no plugins installed? Bests Matthias On 4/20/20 11:08 AM, Drexel Peter wrote: Hi, I use a Python-Script to load all shapefiles in a directory tree one by one and export the sld-files. It works fine, but slows down incredible after ~100 files. So I tried the following barebone script with just the essentials (load shapefile, add it to the map canvas, remove it again and then clear the project) in a loop and I get the same behavior… from datetime import datetime for i in range(1, 1000): vlayer=QgsVectorLayer ("aShapeFile.shp" ,"run " + str(i) + " at " + datetime.now().strftime('%H:%M:%S') ,"ogr") QgsProject.instance().addMapLayer(vlayer) QgsProject.instance().removeMapLayer(vlayer.id()) QgsProject.instance().clear() Same result, the Script slows down after every iteration in the loop AND QGIS-memory consumption goes up! Do I need to do some garbage cleaning / what am I doing wrong / is this a Memory leak? Thanks everybody for any hints / help! Peter ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org<mailto:QGIS-Developer@lists.osgeo.org> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
[QGIS-Developer] Memory Leak / Slowdown?
Hi, I use a Python-Script to load all shapefiles in a directory tree one by one and export the sld-files. It works fine, but slows down incredible after ~100 files. So I tried the following barebone script with just the essentials (load shapefile, add it to the map canvas, remove it again and then clear the project) in a loop and I get the same behavior... from datetime import datetime for i in range(1, 1000): vlayer=QgsVectorLayer ("aShapeFile.shp" ,"run " + str(i) + " at " + datetime.now().strftime('%H:%M:%S') ,"ogr") QgsProject.instance().addMapLayer(vlayer) QgsProject.instance().removeMapLayer(vlayer.id()) QgsProject.instance().clear() Same result, the Script slows down after every iteration in the loop AND QGIS-memory consumption goes up! Do I need to do some garbage cleaning / what am I doing wrong / is this a Memory leak? Thanks everybody for any hints / help! Peter ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
[QGIS-Developer] Embed Layers and Groups / Import whole Project into a loaded QGIS-Project
Hi all, in QGIS3 is there a way to import a whole existing project into an already loaded QGIS-Project (aka add all the Groups and Layers of a Project into an existing Project) within a Python-Script or Plugin? Thanks in advance Peter ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] QGIS, Shapefiles, default encoding
Hi, please, can anyone tell me what default encoding QGIS uses when loading a Shapefile? In my QGIS 2.14.7 on Windows 7 64bit "Ignore shapefile encoding declaration" is checked, so if I load a Shapefile with a corresponding utf-8-cpg-file using "drag and drop" it is encoded as 'system' and the encoding is wrong (what encoding is 'system'?). If I load a Shapefile with a corresponding utf-8-cpg-file using "Add Vector Layer" it is encoded as 'utf-8' and the encoding is fine. In both cases I can change the data source encoding in the properties dialog. Is it possible to change the behavior of drag and drop to use utf-8 If I uncheck "Ignore shapefile encoding declaration" and load the shapefile either using "Add Vector Layer" or drag and drop the cpg-file is interpreted correctly and the encoding is set to utf-8. But now I cannot change the data source encoding in the properties dialog anymore. I think it should still be possible to change the encoding in the properties dialog. Peter ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer