[QGIS-Developer] QGIS standalone script examples (and Oracle)

Paul Wittle paul.wittle at dorsetcouncil.gov.uk
Tue Jun 1 09:48:14 PDT 2021


Thanks,

I might have a look but to be honest there seem to be quite a few ways things can fail.

I have now switched to a template that uses WFS / WMS layers only and they all load accept for a WFS layer using an authentication manager password; others using tokens are fine.

I've checked that the authentication manager is now opening early enough and contains the relevant authcfg ID, which it does, but still it loses the source for that layer as well.

Is there a way to load a project in QGIS and return a list of invalid layers?

I'm assuming that what is happening is that it is loading the project but because it is in Python there is no 'handle bad layers' dialogue as there is in the main GUI.

It would be helpful if that function was available so I could do something like this:

Read Project
    = list of bad layers
Check list, if greater than 0 then handle bad layers
Do stuff
Save project

However I suspect it will be quicker to just switch the method of my WFS layer to match the ones that work.

Thanks,
Paul



-----Original Message-----
From: Richard Duivenvoorde <rdmailings at duif.net>
Sent: 01 June 2021 17:26
To: Paul Wittle <paul.wittle at dorsetcouncil.gov.uk>
Cc: qgis-dev <Qgis-developer at lists.osgeo.org>
Subject: Re: [QGIS-Developer] QGIS standalone script examples (and Oracle)

On 6/1/21 4:12 PM, Paul Wittle wrote:
> You mentioned you'd explicitly set the Oracle paths in something you did previously...is there an Oracle setting that should be set if running QGIS standalone?

QGIS uses the Oracle OCI library to connect to an Oracle Database.

When you install QGIS on Linux you have to add/compile this separately and then compile Linux WITH oracle support.
To be able to use QGIS then you should make sure that you have the Oracle lib in your 'library path'.
AND so if you run a standalone script, it should also be available.

The Windows installers though... (for what I know) already contain the driver (if you use the osgeo4w installer you can check Oracle-Provider/driver separately). Anyway: IF you are on Windows, and use QGIS AND you can view Oracle layers, then you should be good to go: there will be some oracle dll on you system...
On startup of QGIS on Windows, all kind of paths are set, but you should find out from the bat files in the install what those are.

Also: IF you can run the script within QGIS itself (in console) (and not outside) it could be a sign that your script cannot find the oracle libs...  Go through the bat files then to see what paths are set.
BUT all this is guessing, I cannot check this myself...

Regards,

Richard
This e-mail and any files transmitted with it are intended solely for the use of the individual or entity to whom they are addressed. It may contain unclassified but sensitive or protectively marked material and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All traffic may be subject to recording and/or monitoring in accordance with relevant legislation. Any views expressed in this message are those of the individual sender, except where the sender specifies and with authority, states them to be the views of Dorset Council. Dorset Council does not accept service of documents by fax or other electronic means. Virus checking: Whilst all reasonable steps have been taken to ensure that this electronic communication and its attachments whether encoded, encrypted or otherwise supplied are free from computer viruses, Dorset Council accepts no liability in respect of any loss, cost, damage or expense suffered as a result of accessing this message or any of its attachments. For information on how Dorset Council processes your information, please see www.dorsetcouncil.gov.uk/data-protection


More information about the QGIS-Developer mailing list