[QGIS-Developer] QGIS standalone script examples (and Oracle)
Paul Wittle
paul.wittle at dorsetcouncil.gov.uk
Tue May 25 07:04:55 PDT 2021
Hi,
I've now done a test using a PostGIS table instead of Oracle and I get a similar result.
It doesn't ask for security credentials or bring up a handle bad layers dialog but the PostGIS table which is working before you run the script appears as an entry in the layers list but doesn't draw.
The
<layer-tree-layer legend_exp="" source="dbname='TEST' host=*** port=5432 sslmode=allow key='tid' srid=27700 type=Polygon checkPrimaryKeyUnicity='0' table="public"."TEST_PARISHES" (geom)" expanded="1" legend_split_behavior="0" name="TEST_PARISHES" checked="Qt::Checked" id="TEST_PARISHES_0724930d_e27b_4279_ad0d_e0f6f7bf5973" patch_size="-1,-1" providerKey="postgres">
Converts to:
<layer-tree-layer legend_split_behavior="0" patch_size="-1,-1" name="TEST_PARISHES" legend_exp="" id="TEST_PARISHES_0724930d_e27b_4279_ad0d_e0f6f7bf5973" expanded="1" checked="Qt::Checked">
I think the way I'm calling the standalone script must just not work...but I'm not sure why.
Thanks again for all your help on this.
Paul
-----Original Message-----
From: Paul Wittle
Sent: 25 May 2021 08:41
To: rdmailings at duif.net
Cc: qgis-dev <Qgis-developer at lists.osgeo.org>
Subject: RE: [QGIS-Developer] QGIS standalone script examples (and Oracle)
Ah, I see your point.
I will setup a project with a PostGIS table and a couple of WMS layers and see how that fairs.
I terms of the error I get... When I open the project all the layers are there with datasource entries but the Layer name column is blank as is the provider column.
So and entry reads:
Layer name = null Type = vector provider = null Auth config = Edit Datasource = datasource (no errors there)
I therefore assume it is deleting something in the canvas settings that is needed for QGIS to realise the layers are Oracle. This is also proved by the log windows where I get the same number of errors in a PostGIS tab even though I have no PostGIS layers in the project. It appears that QGIS believes them to be PostGIS layers.
I'll have a go at your suggestions now.
Paul
-----Original Message-----
From: Richard Duivenvoorde <rdmailings at duif.net>
Sent: 24 May 2021 16:59
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 5/24/21 2:54 PM, Paul Wittle wrote:
> Unfortunately I can't simply exclude Oracle as that is currently our spatial database provider and whilst we are migrating to PostgresSQL that will be a while so I do need a solution that leaves those layers alone really.
Sorry, I did not mean to exclude Oracle from the final scripts, just to check if another (inbuild db) provider would work instead (as it does not need separate dll's).
> The batch commands I'm referring to include o4w_env.bat, qt5_env.bat and py3_env.bat which I believe are default with the install so hopefully you can see them.
For what I know, both Windows install types (Standalone and osgeo4w) set indeed the right paths using those bat files...
Checking IF the oracle provider is working, you should be able to check with a simple read of an Oracle table and counting the features or so (in pyqgis I mean)?
Anybody has a trick how to find out what exactly is wrong, when a layer is 'invalid'?
Regards,
Richard Duivenvoorde
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