Re: [QGIS-Developer] setDataSourceUri() not working

2022-12-08 Thread Raymond Nijssen via QGIS-Developer

That works!! :O

Thank you so much!!!

Raymond

On 09-12-2022 08:20, Andrea Giudiceandrea via QGIS-Developer wrote:

Hi Raymond,
I wrote setDataSource, not setDataSourceUri.

Regards.

Andrea


Il 09/12/2022 08:19, Raymond Nijssen via QGIS-Developer ha scritto:

Thanks Andrea, but that doesn't seem to exist:

AttributeError: 'QgsVectorLayer' object has no attribute 
'setDataSourceUri'


Raymond


On 08-12-2022 19:42, Andrea Giudiceandrea via QGIS-Developer wrote:

*Raymond Nijssen*
/Wed Dec 7 07:39:50 PST 2022/

I'm trying to change the dataSourceUri of an existing layer


Hi Raymond,
AFAIK you need to use setDataSource [1] directly on the layer an not 
setDataSourceUri on the data provider.


E.g.:

layer.setDataSource(new_ds, layer_name, 'ogr')


Best regards.

Andrea

[1] 
https://qgis.org/pyqgis/master/core/QgsMapLayer.html#qgis.core.QgsMapLayer.setDataSource


___
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


Re: [QGIS-Developer] setDataSourceUri() not working

2022-12-08 Thread Andrea Giudiceandrea via QGIS-Developer

Hi Raymond,
I wrote setDataSource, not setDataSourceUri.

Regards.

Andrea


Il 09/12/2022 08:19, Raymond Nijssen via QGIS-Developer ha scritto:

Thanks Andrea, but that doesn't seem to exist:

AttributeError: 'QgsVectorLayer' object has no attribute 
'setDataSourceUri'


Raymond


On 08-12-2022 19:42, Andrea Giudiceandrea via QGIS-Developer wrote:

*Raymond Nijssen*
/Wed Dec 7 07:39:50 PST 2022/
 


I'm trying to change the dataSourceUri of an existing layer


Hi Raymond,
AFAIK you need to use setDataSource [1] directly on the layer an not 
setDataSourceUri on the data provider.


E.g.:

layer.setDataSource(new_ds, layer_name, 'ogr')


Best regards.

Andrea

[1] 
https://qgis.org/pyqgis/master/core/QgsMapLayer.html#qgis.core.QgsMapLayer.setDataSource


___
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] setDataSourceUri() not working

2022-12-08 Thread Raymond Nijssen via QGIS-Developer

Thanks Andrea, but that doesn't seem to exist:

AttributeError: 'QgsVectorLayer' object has no attribute 'setDataSourceUri'

Raymond


On 08-12-2022 19:42, Andrea Giudiceandrea via QGIS-Developer wrote:

*Raymond Nijssen*
/Wed Dec 7 07:39:50 PST 2022/

I'm trying to change the dataSourceUri of an existing layer


Hi Raymond,
AFAIK you need to use setDataSource [1] directly on the layer an not 
setDataSourceUri on the data provider.


E.g.:

layer.setDataSource(new_ds, layer_name, 'ogr')


Best regards.

Andrea

[1] 
https://qgis.org/pyqgis/master/core/QgsMapLayer.html#qgis.core.QgsMapLayer.setDataSource


___
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


Re: [QGIS-Developer] setDataSourceUri() not working

2022-12-08 Thread Andrea Giudiceandrea via QGIS-Developer

*Raymond Nijssen*
/Wed Dec 7 07:39:50 PST 2022/

I'm trying to change the dataSourceUri of an existing layer


Hi Raymond,
AFAIK you need to use setDataSource [1] directly on the layer an not 
setDataSourceUri on the data provider.


E.g.:

layer.setDataSource(new_ds, layer_name, 'ogr')


Best regards.

Andrea

[1] 
https://qgis.org/pyqgis/master/core/QgsMapLayer.html#qgis.core.QgsMapLayer.setDataSource___
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] Fwd: Dear develop team GIS (plugin)

2022-12-08 Thread Tim Sutton via QGIS-Developer
Hi Richard


I Cc'd in Admire. You can always ping me if there is anything in plugin
land that needs his attention.

Regards

Tim

On Wed, Dec 7, 2022 at 3:26 PM Richard Duivenvoorde via QGIS-Developer <
qgis-developer@lists.osgeo.org> wrote:

> Hi,
>
> I do not have an email address of NyakudayaE, but I asked the perion if it
> is OK like it is now:
>
> https://github.com/IFEERnD/Q5Pfes/issues/1
>
> (https://plugins.qgis.org/plugins/q5pfes/ has no public version yet)
>
> Regards,
>
> Richard Duivenvoorde
>
> On 12/7/22 03:33, Dương Phạm Quang wrote:
> > Dear Richard,
> > Thanks for your guidance, I tried deleting the old plugin and pushing
> the version with the new name but it's been more than 3 weeks now but I
> still haven't received a response or approval.
> > Can you please check in your account's upload plugin list "ifeernd".
> > Or you can give me the email channels email address so I can contact them
> > Thank you!*
> > *
> >
> >
> >
> > Vào Th 6, 28 thg 10, 2022 vào lúc 14:35 Richard Duivenvoorde <
> rdmaili...@duif.net > đã viết:
> >
> > Hi,
> >
> > I think you just have to remove the earlier version (or let me do
> the removal).
> >
> > And then upload the new version with the new name, which will then
> start with 1.2 as first version.
> >
> > Let me know if you want me to delete that version.
> >
> > (note: it is better to communicate via the email channels, then
> others also can help)
> >
> > Regards,
> >
> > Richard Duivenvoorde
> >
> > On 10/28/22 06:43, Dương Phạm Quang wrote:
> >  > thank for you support, our first version have been successful
> upload to QGIS Plugin. But we have a new decision to change our plugin
> name. Can you help us in this case?
> >  >
> >  > Vào Th 4, 19 thg 10, 2022 vào lúc 14:24 Richard Duivenvoorde <
> rdmaili...@duif.net   rdmaili...@duif.net >> đã viết:
> >  >
> >  > The author just sent me the github repo:
> >  > "Our link repo is: https://github.com/IFEERnD/v5Pfes <
> https://github.com/IFEERnD/v5Pfes>  https://github.com/IFEERnD/v5Pfes>>"
> >  >
> >  > @Pham Quang Duong am I right that this plugin is only in
> Vietnamees language?
> >  > Can you maybe provide some information (in english, in the
> README.txt (which is now empty)) about what the plugin is supposed to do,
> or maybe a little guide about how to test?
> >  > Most people approving the plugins are English
> speaking/reading ( or at least without knowledge of Vietnamees writing :-)
> ) , so without any guidance cannot tell what the plugin is doing, unless
> they deep dive into the code.
> >  >
> >  > Regards,
> >  >
> >  > Richard Duivenvoorde
> >  >
> >  > On 10/19/22 09:13, Werner Macho wrote:
> >  >  > Hi Richard,
> >  >  > I also searched for the user id "ifeernd" - and could
> not find it.
> >  >  > Maybe it is not a plugin and something
> completely different is meant?
> >  >  >
> >  >  > regards
> >  >  > werner
> >  >  >
> >  >  > On Wed, Oct 19, 2022 at 9:02 AM Richard Duivenvoorde via
> QGIS-Developer  qgis-developer@lists.osgeo.org>  >  qgis-developer@lists.osgeo.org 
>  >  >  >
> >  >  > Hi Devs,
> >  >  >
> >  >  > This mail was (accidently wrong) sent to the list
> owner of the dev list.
> >  >  >
> >  >  > Sender tells us a plugin was sent in 2 weeks ago.
> >  >  >
> >  >  > If I search for V5Pfes I only see 'None', if I search
> for Forest I see None again.
> >  >  >
> >  >  > Is there something wrong with the metadata of the
> plugin?
> >  >  > I think I normally see the name of the plugin, even
> when it is not approved?
> >  >  >
> >  >  > @Pham Quang Duong can you maybe sent the link of you
> repo?
> >  >  >
> >  >  > Regards,
> >  >  >
> >  >  > Richard Duivenvoorde
> >  >  >
> >  >  >
> >  >  >  Forwarded Message 
> >  >  > Subject:Dear develop team GIS
> >  >  > Date:   Tue, 18 Oct 2022 16:47:19 +0700
> >  >  > From:   Dương Phạm Quang    >     >  >  > To: qgis-developer-ow...@lists.osgeo.org  qgis-developer-ow...@lists.osgeo.org>  

Re: [QGIS-Developer] setDataSourceUri() not working

2022-12-08 Thread Julien Cabieces via QGIS-Developer


Hi,

dataSourceUri is used when creating the dataProvider/vectorlayer and 
there is no way to refresh the provider according to a new uri.

I don't see any other way than recreate a new QgsVectorLayer with the
new dataSource uri, add it to your project instance with addMapLayer and
remove the old one.

Maybe there is a trick to simplify things but I fail to see how.

Regards,
Julien


> Hi Devs,
>
> I'm trying to change the dataSourceUri of an existing layer, but can't 
> get it working. The reason is that my layer should be connected to 
> another view in the same database, because the db should do some 
> calculations for my plugin.
>
> I created a test script for a simple polygon layer in a gpkg, which I 
> attached to this email. The layer "polygons" and both views are all 
> working correctly if you just drag and drop the gpkg in QGIS.
>
> Open the polygons layer and select it. Then run:
>
>
> layer = iface.activeLayer()
> provider = layer.dataProvider()
>
> ds = provider.dataSourceUri()
> print(ds)
>
> fn = ds.split('|layername=')[0]
> new_ds = fn + '|layername=highest_3_view'
> print(new_ds)
>
> provider.setDataSourceUri(new_ds)
>
>
>
>
> The first run displays 2 different dataSourceUris:
> path/to/test_views.gpkg|layername=polygons
> path/to/test_views.gpkg|layername=highest_3_view
>
> The second run displays 2x the same dataSourceUris:
> path/to/test_views.gpkg|layername=polygons
> path/to/test_views.gpkg|layername=highest_3_view
>
> So the string has been changed. But my layer properties still point to 
> path/to/test_views.gpkg|layername=polygons
>
> and the features displayed are all 5 from the polygons layer. (The views 
> have only 3 features)
>
>
>
> Should i do something after setting the new provider? I've been trying 
> many things, including:
> * provider.reloadData()
> * layer.setDataProvider(dataprovider)
> * refreshing/redrawing the layer
>
>
> Hope anyone can help!
> Raymond___
> 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] setDataSourceUri() not working

2022-12-08 Thread Raymond Nijssen via QGIS-Developer

Hi Devs,

I'm trying to change the dataSourceUri of an existing layer, but can't 
get it working. The reason is that my layer should be connected to 
another view in the same database, because the db should do some 
calculations for my plugin.


I created a test script for a simple polygon layer in a gpkg, which I 
attached to this email. The layer "polygons" and both views are all 
working correctly if you just drag and drop the gpkg in QGIS.


Open the polygons layer and select it. Then run:


layer = iface.activeLayer()
provider = layer.dataProvider()

ds = provider.dataSourceUri()
print(ds)

fn = ds.split('|layername=')[0]
new_ds = fn + '|layername=highest_3_view'
print(new_ds)

provider.setDataSourceUri(new_ds)




The first run displays 2 different dataSourceUris:
path/to/test_views.gpkg|layername=polygons
path/to/test_views.gpkg|layername=highest_3_view

The second run displays 2x the same dataSourceUris:
path/to/test_views.gpkg|layername=polygons
path/to/test_views.gpkg|layername=highest_3_view

So the string has been changed. But my layer properties still point to 
path/to/test_views.gpkg|layername=polygons


and the features displayed are all 5 from the polygons layer. (The views 
have only 3 features)




Should i do something after setting the new provider? I've been trying 
many things, including:

* provider.reloadData()
* layer.setDataProvider(dataprovider)
* refreshing/redrawing the layer


Hope anyone can help!
Raymond

test_views.gpkg
Description: application/geopackage
___
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] QGIS budget 2023 RFC

2022-12-08 Thread WhereGroup

Hi everyone,

just a quick note, next to the super interesting and important 
discussion that happened already.


I think it is fantastic that there will be a dedicated person doing 
documentation work. Documentation created by many hands and minds is 
often very varying in tone, detail, quality, up-to-dateness etc, plus it 
is a lot of work to even just contribute small things, so this is a 
great opportunity to "collect the threads".


Thank you for investing in this!

Cheers, Hannes

PS: I recently read into https://diataxis.fr/ and this looks like a 
great framework IF docs are meant to be significantly cleaned up and 
restructed.


Am 24.11.22 um 13:31 schrieb Andreas Neumann via QGIS-Developer:

Hi all,

Maybe we should a few explanations to the budget draft - since there 
are some substantial changes compared to the last year budget.


We increased two budget items:

  * Maintenance / Sysadmin QGIS.ORG  server
infrastructure
  * QGIS documentation contribution

The intention is to allow for a regular small salary on these two 
items for one person on each item. It is an experiment next year - and 
if it works out well, we may continue in 2024.


In exchange for these two increases we had to decrease other items. We 
slightly decreased the "bug fixing" positions, and unfortunately also 
the "QGIS grant" section had to be reduced to 10k.


If there is additional income, we can again increase the bug fixing 
items. We'll also monitor the 2022 income and if it increases 
substantially until the end of the year, we will probably increase the 
bug fixing items.


Do you have any questions or remarks on the budget draft for 2023?

Thank you for your feedback,
Andreas

On Thu, 24 Nov 2022 at 12:07, Marco Bernasocchi via QGIS-Developer 
 wrote:


Hi all,
we prepared the QGIS budget for 2023 and would like to have
feedback before submitting it to the voting members for approval.
You can directly leave comments in the file [1].

Please let us have any Feedback until December 4th. On december
7th we'll send the budget for vote.

Cheers
Marco

[1]

https://docs.google.com/spreadsheets/d/1WyoZCKOehNhU5YB4pFPOuiJbie1mUmMPiq8YW7qyez0/edit?usp=sharing

-- 
Marco Bernasocchi


QGIS.org Chair
OPENGIS.ch CEO
http://berna.io
___
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



--

--
Andreas Neumann
QGIS.ORG  board member (treasurer)

___
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

-
Where2B Konferenz 2022
15. Dezember 2022 in Bonn und Online
https://where2b-conference.com/
-

WhereGroup GmbH
Grevenweg 89
20537 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