Re: [QGIS-Developer] Catch PostgreSQL logs in pyqgis
Hi Matteo, https://api.qgis.org/api/master/classQgsDatabaseQueryLog.html does have appropriate signals (queryFinished and queryStarted, both include the query) but it looks like they are not documented in the Python API https://qgis.org/pyqgis/master/core/QgsDatabaseQueryLog.html It *looks* like they are exposed though. So try def do_something_with(query): ... query_log = QgsApplication.databaseQueryLog() query_log.queryFinished.connect(do_something_with) If that does not work, maybe the debugging panel itself has a signal you can connect to as a hacky workaround. Cheers, Hannes On 04.03.24 17:54, Matteo Ghetta via QGIS-Developer wrote: Hi devs, I'm looking for a way in pyqgis to catch the (raw) queries that QGIS is sending to the PostgreSQL provider when a table is edited: for example the raw "INSERT ... INTO ...", "UPDATE ...". Basically what the Development Panel is listing when enabled. Is there a way in pyqgis? Cheers and thanks for any suggestion! Matteo ___ 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 -- Johannes Kröger / GIS-Entwickler/-Berater * FOSSGIS Konferenz 20.-23. März 2024 in Hamburg https://www.fossgis-konferenz.de/2024/ WhereGroup-Beiträge auf der FOSSGIS https://wheregroup.com/unternehmen/aktuelles/ * WhereGroup GmbH c/o KK03 GmbH Lange Reihe 29 20099 Hamburg Germany Tel: +49 (0)228 / 90 90 38 - 36 Fax: +49 (0)228 / 90 90 38 - 11 johannes.kroe...@wheregroup.com www.wheregroup.com Geschäftsführer: Olaf Knopp, Peter Stamm Amtsgericht Bonn, HRB 9885 --- ___ 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] Ubuntu GIS repo with new gdal, LERC and ZSTD support?
Hi Andreas, On Mon, 04. Mar 2024 at 17:51:56 +0100, Andreas Neumann via QGIS-Developer wrote: > I am wondering if there is a ubuntu (or debian) package repository available > with a relatively new gdal, LERC and ZSTD support? Ideally a repo that can > be added to Ubuntu 22.04 > Thank you if you know some package source? ubuntugis for jammy has GDAL 3.8.3 (but lacks LERC support; but has PDAL 2.6.2). Debian unstable has GDAL 3.8.4 with LERC support (but is not suited for jammy). We have QGIS builds of the release branches and master for both of them (ubuntugis and debian just the LTR branch). Jürgen -- Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31 Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50 Software Engineer D-26506 Nordenhttps://www.norbit.de QGIS release manager (PSC) Germany IRC: jef on Libera|OFTC signature.asc Description: PGP signature ___ 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] Ubuntu GIS repo with new gdal, LERC and ZSTD support?
#osgeolive is a project of OSGeo dot org, and is part of the developer chain that builds UbuntuGIS https://live.osgeo.org An experimental build of new GDAL and QGIS can be found here https://launchpad.net/~ubuntugis/+archive/ubuntu/ubuntugis-experimental/+packages This is fresh-paint new and needs some testing. A preferred way to test is to enable the UbuntuGIS repo, and then this repo on top of that. If people have the skills, please try and report back to UbuntuGIS mailing list. apt source => deb http://ppa.launchpad.net/osgeolive/release-16.0/ubuntu jammy main https://lists.osgeo.org/mailman/listinfo/ubuntu hth- ##-- Brian M Hamlin / MAPLABS / OSGeoLive PSC On 3/4/24 08:51, Andreas Neumann via QGIS-Developer wrote: Hi, I am wondering if there is a ubuntu (or debian) package repository available with a relatively new gdal, LERC and ZSTD support? Ideally a repo that can be added to Ubuntu 22.04 I compiled things myself in the past, but it would be convenient for docker containers to install from binaries. Thank you if you know some package source? Andreas ___ 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 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] Catch PostgreSQL logs in pyqgis
Hi devs, I'm looking for a way in pyqgis to catch the (raw) queries that QGIS is sending to the PostgreSQL provider when a table is edited: for example the raw "INSERT ... INTO ...", "UPDATE ...". Basically what the Development Panel is listing when enabled. Is there a way in pyqgis? Cheers and thanks for any suggestion! Matteo ___ 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] Ubuntu GIS repo with new gdal, LERC and ZSTD support?
Hi, I am wondering if there is a ubuntu (or debian) package repository available with a relatively new gdal, LERC and ZSTD support? Ideally a repo that can be added to Ubuntu 22.04 I compiled things myself in the past, but it would be convenient for docker containers to install from binaries. Thank you if you know some package source? Andreas___ 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 & field computer and unauthorized DB structure change
Hello everyone, I have noticed the following: if I have read and write access (DML) to a PostgreSQL table, but no access to structure changes (DDL), then I can, for example, add new columns with the field calculator and fill them with results. Everything seems to run normally, I do not get a warning that I am not allowed to change the structure, the results generated in the field calculator are OK. After saving, all new columns including the data are gone. Can a corresponding preliminary check with warning be added here please? If a new column is explicitly added, a message appears whose content does not match the situation. "Could not add field 'Test' of type 'text'. Is the field name unique?“ A warning regarding missing authorizations for DB structure changes would be better. As far as I know, there is no QGIS ticket or change request(https://github.com/qgis/QGIS/issues) to improve the user guidance for these two cases. There are currently two relevant sections in the error messages(https://github.com/qgis/QGIS/blob/master/i18n/qgis_de.ts). Failed to add field '%1' of type '%2'. Is the field name unique? Could not add field '%1' of type '%2'. Is the field name unique? Failed to add field '%1' of type '%2'. Is the field name unique? Could not add field '%1' of type '%2'. Is the field name unique? Many thanks in advance. Mike Elstermann ___ 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] QgsGeometry's .get() and segfaults
Hi, Calling get() means that you get a reference of the QgsAbstractGeometry used by the QgsGeometry object, but the QgsGeometry object (g) is still the ownership of the QgsAbstractGeometry object (g_geom). So, if you delete your QgsGeometry (g) you delete the owned QgsAbstractGeometry (g_geom). And you would get quite the same issue if you wanted to delete g_geom. Best is to use constGet() and clone() your returned QgsAbstractGeometry if you want to manipulate it independantly from its original QgsGeometry owner. Regarding detach(), it's because of a design pattern called "Implicit Data Sharing" or "copy on write". When we copy a QgsGeometry, both objects are, under the hood, referencing the same memory object (QgsGeometryPrivate d). When you end up modifying one of the object (moveVertex for instance), you detach the modified object so the two are no longer sharing the memory private object (hence the name "copy on write"). That's what happen when we call get(), we need to detach so other QgsGeometry object would not be impacted by later modification of the non-const returned object. Hope that makes sense :) Julien > Hi list! > > I am using some time to learn more about the relationships between > Python, C++, SIP, the QGIS API and everything in-between. > > And currently I am confused why this Python snippet leads to a segfault: > > from qgis.core import QgsGeometry > g = QgsGeometry.fromWkt("POINT (1 2)") > g_geom = g.get() > del g > print(g_geom.asWkt()) > > I understand that deleting wrapped objects can lead to unexpected > deletions of related objects (e. g. if I delete a PyQt parent object > and then try to use an existing reference/"variablename" to a child of > it) but at least from the documentation this does not seem related to > that. > > https://github.com/qgis/QGIS/blob/dc73608a60229c9960ee65e308cfaba5f32566ec/src/core/geometry/qgsgeometry.h#L196 > says about QgsGeometry.get(): >> Returns a modifiable (non-const) reference to the underlying > abstract geometry primitive. This method can be slow to call, as it > may trigger a detachment of the geometry and a deep copy. Where > possible, use constGet() instead. > > I do not understand anything in the detach() function itself > https://github.com/qgis/QGIS/blob/dc73608a60229c9960ee65e308cfaba5f32566ec/src/core/geometry/qgsgeometry.cpp#L102 > :o) > > Would my small snippet lead to a reference to the C++ object's > geometry? Then I'd understand the segfault (although not why it would > not trigger one of the usual "wrapped C/C++ object of type [...] has > been deleted" errors) if I try to access it after the whole > QgsGeometry might have been destroyed. > Or does it get a "detached deep copy"? In that case it sounds like an > independent object to me but I might be completely wrong. > > Are there any C++ or SIP terms you could throw my way for further reading? > > Thanks for your help! > > Cheers, Hannes > > ___ > 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 -- Julien Cabieces Senior Developer at Oslandia julien.cabie...@oslandia.com ___ 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] cache management on Github workflows
Hi Denis, And thank you for this work! Regards, Julien > Dear all, > > You might have noticed heavy traffic for the last 24h on the Github actions. > > There was an issue in the former workflow and I took the opportunity to clean > up the situation. > > I have moved to upstream save cache action. > Now, for all architectures and parameters, only the branch builds are cached > (not the PR anymore). This should solve the cache issues we had > on Github. > This means that the builds should be faster again hopefully for PRs that at > least don't edit qgis.h. > > You might need to close and re-open your PR to trigger the updated workflow > again. > > I'll also try to update the workflow in the 3.34 release branch (3.36 is on > the way already). > > Sorry for the mess it has caused. > > Have a good weekend, > > Denis > > ___ > 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 -- Julien Cabieces Senior Developer at Oslandia julien.cabie...@oslandia.com ___ 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