Re: [QGIS-Developer] GSoC 2024 proposal : QGIS improve the graphical modeler UI and UX

2024-02-22 Thread Raymond Nijssen via QGIS-Developer
Wow Valentin, that plan looks awesome! I'm using both QGIS and Blender 
and often wondered if the QGIS modeler could be improved.


Good luck with work and kind regards,
Raymond


On 22-02-2024 08:37, Valentin BUIRA via QGIS-Developer wrote:

Hi qgis developers

My name is Valentin Buira, I'm a french student in urban planning and 
I'm interested in participating in this year Google Summer of Code to 
improve the graphical modeler.


In particular I am interested in improving the user interface(UI) and 
user experience (UX) of the graphical modeler based on my previous 
experience with other node-based applications. If you are familiar with 
Blender the inspiration will be obvious to you but I tried to adapt to 
the identity and features of Qgis like the expression engine.


You can find the proposal at the url : 
https://docs.google.com/document/d/1iXHMTylTHLljfHBITfuIfJzi4_4hpQifEvj5GkM8OCc/edit?usp=sharing 


So far I am happy with my proposal but I'm looking for feedback and 
suggestions, and also tips on the technical feasibility and the schedule 
of the proposal.


On a side note, I will be attending the local code sprint in Grenoble 
the 26 mars. Where I will also discuss this proposal in person.


Best regards,
Valentin Buira



___
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] Code repository link not updated in Plugin manager and plugin website

2024-01-29 Thread Raymond Nijssen via QGIS-Developer

Thanks for replying Matthias. Done:

https://github.com/qgis/QGIS-Django/issues/350

Lova, let me know if I can help you with testing or something else.

This is the plugin that should get updated:
https://plugins.qgis.org/plugins/wfs_styler/#plugin-versions

Raymond


On 29-01-2024 08:53, Matthias Kuhn wrote:

Hi Raymond

Lova is doing some excellent work on the plugin repository recently.
Maybe he will find the time to look into this?
In any case, I think it would be worth opening an issue with your 
research on https://github.com/qgis/QGIS-Django/issues 
<https://github.com/qgis/QGIS-Django/issues> to not forget about it and 
have a contextualized discussion.


Kind regards
Matthias

On Mon, Jan 29, 2024 at 8:45 AM Raymond Nijssen via QGIS-Developer 
mailto:qgis-developer@lists.osgeo.org>> 
wrote:


Diving in the code I found a few suspicious lines.

1. In the Django code, there's no mention of "repository" in this list:


https://github.com/qgis/QGIS-Django/blob/6d03c8428abe9df7634bbf810bbcb63709b11d45/qgis-app/plugins/views.py#L908
 
<https://github.com/qgis/QGIS-Django/blob/6d03c8428abe9df7634bbf810bbcb63709b11d45/qgis-app/plugins/views.py#L908>

2. In the QGIS code, the PluginManager seems to look for
"code_repository" and not "repository".


https://github.com/qgis/QGIS/blob/4293d4f1c57614e0a4d3835b7d9f18b3a78bcbd1/src/app/pluginmanager/qgspluginmanager.cpp#L991
 
<https://github.com/qgis/QGIS/blob/4293d4f1c57614e0a4d3835b7d9f18b3a78bcbd1/src/app/pluginmanager/qgspluginmanager.cpp#L991>

Hope this helps fixing it. I currently don't have time to setup the
Django environment and and try fixing it myself.

Raymond


On 26-01-2024 10:03, Raymond Nijssen via QGIS-Developer wrote:
 > Dear developers,
 >
 > I found some unexpected behaviour in the plugin management.
 >
 > I changed the the plugin source code to another github repository
and
 > wanted to update the links in the plugin metadata.
 >
 > 1. When updating the metadata localy, and running the plugin from
local
 > code, the metadata changelog is updated (so I know QGIS has read the
 > metadata.txt) but the links to the code, homepage and tracker are
still
 > pointing to the old repository.
 >
 > 2. After uploading the new version of the plugin to the QGIS plugin
 > repository, the links to homepage and tracker are updated but the
link
 > to the code keeps pointing to the old location. (See screenshot)
 >
 > Is this a bug? If so, where should I file it?
 >
 > Kind regards and happy QGIS Open Day! :)
 >
 > Raymond
 >
 > ___
 > 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
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>
 > Unsubscribe:
https://lists.osgeo.org/mailman/listinfo/qgis-developer
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>
___
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
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
<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] Code repository link not updated in Plugin manager and plugin website

2024-01-28 Thread Raymond Nijssen via QGIS-Developer

Diving in the code I found a few suspicious lines.

1. In the Django code, there's no mention of "repository" in this list:

https://github.com/qgis/QGIS-Django/blob/6d03c8428abe9df7634bbf810bbcb63709b11d45/qgis-app/plugins/views.py#L908

2. In the QGIS code, the PluginManager seems to look for 
"code_repository" and not "repository".


https://github.com/qgis/QGIS/blob/4293d4f1c57614e0a4d3835b7d9f18b3a78bcbd1/src/app/pluginmanager/qgspluginmanager.cpp#L991

Hope this helps fixing it. I currently don't have time to setup the 
Django environment and and try fixing it myself.


Raymond


On 26-01-2024 10:03, Raymond Nijssen via QGIS-Developer wrote:

Dear developers,

I found some unexpected behaviour in the plugin management.

I changed the the plugin source code to another github repository and 
wanted to update the links in the plugin metadata.


1. When updating the metadata localy, and running the plugin from local 
code, the metadata changelog is updated (so I know QGIS has read the 
metadata.txt) but the links to the code, homepage and tracker are still 
pointing to the old repository.


2. After uploading the new version of the plugin to the QGIS plugin 
repository, the links to homepage and tracker are updated but the link 
to the code keeps pointing to the old location. (See screenshot)


Is this a bug? If so, where should I file it?

Kind regards and happy QGIS Open Day! :)

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


Re: [QGIS-Developer] QGIS Repo Is Not Updated

2023-11-14 Thread Raymond Nijssen via QGIS-Developer

Hi Murat,

Updating can take a bit of time, cause the xml file is cached on the 
server. Try again in 15 or 30 minutes.


Raymond


On 14-11-2023 13:06, Murat Çalışkan via QGIS-Developer wrote:

Hello,
I updated my plugin and it is approved.
It's updated in plugin repository but in QGIS it is not updated.

I checked and in "/*https://plugins.qgis.org/plugins/raster_divider 
*/" it is updated(1.3) 
but in "/*https://plugins.qgis.org/plugins/plugins.xml?qgis=3.28 
*/" old 
version(1.2) still remains. Name of plugin is "*Raster Divider*"


___
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] My own LayoutItem not getting rendered unless ...

2023-09-11 Thread Raymond Nijssen via QGIS-Developer

Hi,

For a plugin I made my own type of layoutItem which renders some kind of 
special graph. However, when the code adds the item to a layout, the 
rectangle is there but the content does not get rendered.


Now when I run this line in the console:

layout_manager = QgsProject.instance().layoutManager()

the layout item does get rendered, and also every next layout works 
properly. I put the line of code just above my layout item's class 
definition and it solves the problem. But I'd like to know if this is 
the right approach and why this line of code is needed. (Or if this is a 
bug?)


Thanks!

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


Re: [QGIS-Developer] Loading layer from specific table/view after running algorithm

2023-08-07 Thread Raymond Nijssen via QGIS-Developer

Found the answer to my own question in old posts here. (Thank you Matteo!)

I have added this code to the processAlgorithm() function:

```
context.addLayerToLoadOnCompletion(
f'{gpkg_fn}|layername=my_view',
context.LayerDetails(
name='my_view',
project=context.project()
)
)
```

Seems to work at least.

Raymond


On 07-08-2023 20:18, Raymond Nijssen via QGIS-Developer wrote:

Hi developers,

I have created a processing algorithm in python that creates a new gpkg 
database with a bunch of tables and views. One of the views can be 
loaded as a polygon layer, which works fine when loaded manually.


How can I tell QGIS to load that view as a polygon layer when the 
algorithm has finished? (I think it must be the same as telling the 
layername to load from the geopackage)


So far, I have tried both QgsProcessingParameterFileDestination and 
QgsProcessingParameterVectorDestination as output parameters without 
much luck.


Hope anyone can help. Kind regards,
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] Loading layer from specific table/view after running algorithm

2023-08-07 Thread Raymond Nijssen via QGIS-Developer

Hi developers,

I have created a processing algorithm in python that creates a new gpkg 
database with a bunch of tables and views. One of the views can be 
loaded as a polygon layer, which works fine when loaded manually.


How can I tell QGIS to load that view as a polygon layer when the 
algorithm has finished? (I think it must be the same as telling the 
layername to load from the geopackage)


So far, I have tried both QgsProcessingParameterFileDestination and 
QgsProcessingParameterVectorDestination as output parameters without 
much luck.


Hope anyone can help. Kind regards,
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


Re: [QGIS-Developer] QGIS Ghostscript critical-severity

2023-07-24 Thread Raymond Nijssen via QGIS-Developer

Has been mentioned here before. Check this thread:

https://lists.osgeo.org/pipermail/qgis-user/2023-July/053212.html

Raymond

On 24-07-2023 08:06, Raul Lupascu via QGIS-Developer wrote:

Hello,

the current Version of QGIS is using Ghostscript-files which are severe 
vulnerabilities.

It is using the Version 9.55.0.


It would be recommended to release a new version of QGIS with the 
current version of ghostscript to close the security gap.


Thank you in advance!


*Mit freundlichen Grüßen
i.A.
Raul Lupascu*
*IT Administrator*
*
*
*

*

Stadt Iserlohn
Der Bürgermeister
Ressort III - Ressort Bürger, Sicherheit, IT
35 - Bereich IT

Raum 0.48
Max-Planck-Straße 5b
58638 Iserlohn

Tel.: 02371 217 1153
raul.lupa...@iserlohn.de 
www.iserlohn.de 



/
/
/Diese E-Mail enthält vertrauliche Informationen. Sollten Sie nicht 
die/der beabsichtigte Empfänger/in sein, informieren Sie bitte 
unverzüglich die/den Absender/in und löschen Sie diese E-Mail. 
//Jegliche Vervielfältigung, Weiterleitung und Veröffentlichung ist 
untersagt./



___
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] FOSS4G Community Sprint

2023-06-15 Thread Raymond Nijssen via QGIS-Developer

To everyone attending FOSS4G 2023 in Prizren,

There won't be a QGIS Contributor Meeting connected to the FOSS4G 
conference this year. But there will be an OSGeo Community Sprint during 
the weekend after the main conference (July 1+2). This is a "contributor 
meeting" for all OSgeo projects, so QGIS should be represented as it is 
the best, coolest, fasted, most widely used and most beautiful project 
in OSGeo, made by the smartest, nicest, funniest and most modest people!


Hope to see you there!
Raymond

https://wiki.osgeo.org/wiki/FOSS4G_2023_Community_Sprint
___
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] Multiple python scripts in python console?

2023-05-05 Thread Raymond Nijssen via QGIS-Developer

Hi Klaus,

Thank you so much, it works!!

Replying to you and the dev list, hoping this solution will end up in 
the same thread.


Kind regards,

Raymond


On 05-05-2023 12:52, Klaus Affeldt wrote:

Hi Raymond,

can't write to the list yet, so i answer you directly:

The python console has a different working directory then the called script.
You have to find out the path of the script and append it to the python search 
path.


# script_1.py

import os
from console.console import _console

# name and path of this script
script_path = _console.console.tabEditorWidget.currentWidget().path

# only the path
path=(os.path.dirname(script_path))+"/"
print (path)

# append python search path
import sys
sys.path.append(path)

from script_2 import TestClass

obj1 = TestClass('Ray')
print(obj1)


# to dynamicly reload changes on script_2.py
import imp

import script_2

imp.reload(script_2)
obj1 = script_2.TestClass('Ray')
print(obj1)



Mit freundlichen Grüßen

Ihre PV ANSPERGER mbH

Klaus Affeldt

Zentrale Kamp-Lintfort
Südstraße 25
47475 Kamp-Lintfort
Tel. +49 2842 9635-14
Fax: +49 2842 9635-99
https://www.ansperger.de






Hi developers,

While writing a python script in the QGIS python console editor I needed
to write a new class and for convenience I put that in its own python file.

Both files are in the same directory, but I cannot import my class in
the other script.

Here's an example:


# script_1.py

from .script_2 import TestClass
obj1 = TestClass('Ray')
print(obj1)




# script_2.py:

class TestClass():

  def __init__(self, name):
  self.name = name

  def __str__(self):
  return f'TestClass[{self.name}]'



It all works properly if I put my class definition in script_1 but as
the code is growing (and a customer of mine needs to understand this
too) it would really be nice to split the code over multiple files.
Is there a way? Or another approach?

Kind regards,
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


Re: [QGIS-Developer] Multiple python scripts in python console?

2023-05-04 Thread Raymond Nijssen via QGIS-Developer

Hi Etienne,

Already tried what you are describing. Indeed it's inconvenient, and 
sometimes the changes in the class code did not end up in the class 
definition. For example, a newly defined function on the class was 
unknown in script_1. Might be a bug, but I'm not even sure.


So the best way should be to tell QGIS to run another python script in 
the console. Or go the plugin way.


Thanks and kind regards,

Raymond


On 04-05-2023 11:29, Etienne Trimaille wrote:
If you are talking about the simple Python console panel, and loading 
Python files from there, then you can skip the " from .script_2 import 
TestClass".


If you notice, when you launch the script_2.py, you have a generated 
line similar to :

exec(Path('/tmp/tmp5g244g4w.py').read_text())

So it's reading and executing all the content of file 2 in the console 
context already.
So then, when file 1 will be executed, there will already be the class 
TestClass in the console context.


But, then to manage multiple files, it's not convenient. You should 
think about the smallest plugin, for instance 
https://github.com/wonder-sk/qgis-minimal-plugin 
<https://github.com/wonder-sk/qgis-minimal-plugin> Otherwise, it's 
difficult to manage IMHO.


Le jeu. 4 mai 2023 à 08:59, Raymond Nijssen via QGIS-Developer 
mailto:qgis-developer@lists.osgeo.org>> 
a écrit :


Hi developers,

While writing a python script in the QGIS python console editor I
needed
to write a new class and for convenience I put that in its own
python file.

Both files are in the same directory, but I cannot import my class in
the other script.

Here's an example:


# script_1.py

from .script_2 import TestClass
obj1 = TestClass('Ray')
print(obj1)




# script_2.py:

class TestClass():

      def __init__(self, name):
self.name <http://self.name> = name

      def __str__(self):
          return f'TestClass[{self.name <http://self.name>}]'



It all works properly if I put my class definition in script_1 but as
the code is growing (and a customer of mine needs to understand this
too) it would really be nice to split the code over multiple files.
Is there a way? Or another approach?

Kind regards,
Raymond
___
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
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
<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] Multiple python scripts in python console?

2023-05-03 Thread Raymond Nijssen via QGIS-Developer

Hi developers,

While writing a python script in the QGIS python console editor I needed 
to write a new class and for convenience I put that in its own python file.


Both files are in the same directory, but I cannot import my class in 
the other script.


Here's an example:


# script_1.py

from .script_2 import TestClass
obj1 = TestClass('Ray')
print(obj1)




# script_2.py:

class TestClass():

def __init__(self, name):
self.name = name

def __str__(self):
return f'TestClass[{self.name}]'



It all works properly if I put my class definition in script_1 but as 
the code is growing (and a customer of mine needs to understand this 
too) it would really be nice to split the code over multiple files.

Is there a way? Or another approach?

Kind regards,
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


Re: [QGIS-Developer] Developer for QGIS Plugin

2023-03-08 Thread Raymond Nijssen via QGIS-Developer

Hi Berit,

Have a look at this list of companies that provide commercial QGIS support:

https://qgis.org/en/site/forusers/commercial_support.html

Many of them will be able to help you with plugin development.

Kind regards,
Raymond

Terglobo
The Netherlands



On 08-03-2023 08:55, Mohr, Berit via QGIS-Developer wrote:

Dear All,

I am writing to you to request for some help.

My name is Berit Mohr and I am a consultant within the Digital 
Innovation Unit at GFA Consulting Group GmbH. We are a development 
cooperation company and our clients are mostly development banks or 
government agencies.


We have a new tender that we want to apply to which has the objective to 
develop a QGIS Plugin that is able to implement their climate positive 
land use strategy.


Although I have a strong background in GIS myself, the tender is too big 
for one person alone.


If you are interested in knowing more, please let me know and I am 
looking forward to your mail


Mit freundlichen Grüßen *·*Kind regards

*Berit Mohr *

Consultant

Digital Innovation Unit

P: +49 40 603060 

E: berit.m...@gfa-group.de 



*GFA Consulting Group GmbH *

Eulenkrugstraße 82 *·*22359 Hamburg *·*Germany

Managing Directors: Anja Desai, Dr. Ilona Schadl, Dr. Heiko Weißleder

Register of Companies: Local Court Hamburg, HRB 30219

*www.gfa-group.de  *




___
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] Release 3.30 delayed

2023-03-03 Thread Raymond Nijssen via QGIS-Developer

So sorry... 😅

Rymond
Terglobo
's-Hertogenbosch
The Netherlands

On 03-03-2023 15:48, Jürgen E. Fischer via QGIS-Developer wrote:

Hi,

the apostrophe in the new release name was a little issue, but there's
another issue with transifex: for some reason the spanish translation
dropped below 35% and would be removed…

I'm currently trying to sort that out with transifex support…

I have pending commits for release-3_28, master (and a local release-3_30
branch).  Please don't push for the time beeing.


Jürgen


___
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] International QGIS User Conference & Contributor Meeting 2023

2023-02-02 Thread Raymond Nijssen via QGIS-Developer

Dear users and developers,

After waiting for 3 years we are happy to announce that the conference 
website is live:


https://uc2023.qgis.nl/

More details will follow soon, but for now please register and propose 
your talks and/or workshops.


And especially for those who'd like to attend the Contributor Meeting, 
please book your stay early cause hotels are mentioning not having too 
many free rooms.


We hope to see you all in The Netherlands soon!

Kind regards,
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


Re: [QGIS-Developer] language dependency qgis_process

2023-01-19 Thread Raymond Nijssen via QGIS-Developer

Hi Michael,

I agree with Richard that algorithm outputs should not be different when 
using other locales.


However, there's a Rename Field algorithm (native:renametablefield) that 
might be useful for you.


Kind regards,
Raymond


On 19-01-2023 08:37, Richard Duivenvoorde via QGIS-Developer wrote:

Hi Michael,

I'm not 100% sure, but I would think that such fields should never be 
translated?

Not in Desktop nor in scripts?

What do other think?

Or has processing some language aware dict with all languages in it?

Regards,

Richard Duivenvoorde

On 1/17/23 22:37, Dr. Michael Hälsig via QGIS-Developer wrote:

Hi,
I am using qgis_process stand alone (Linux desktop or Linux headless 
server)
and run e.g. an overlap analysis, This algorithm adds a field 
'Buffered_pc'.


When I use the processing inside the QGIS desktop, the overlap 
algorithm names

the added field 'Gepuffert_pc', because I am using the German locale.

But I need for the further processing the German version of the field 
name.


Apparently qgis_process creates a file in ~/.config/Unknown Organization/
qgis_process.bin.conf with the content 
'localized_data_paths=@Invalid()'. It

seems to be that qgis_process expects somewhere the path for the German
localization.

How do I tell qgis_process to use the German locale?

Thank you for any hints.

Michael



___
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 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] Save the dates - Contributor Meeting 2023

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

Hi Anita,

Thank you. No major changes, the program is still like I posted in my 
last "save more dates" post:


April 2023
--
Tue 18 | User Conference + Workshops
Wed 19 | User Conference + Workshops
Thu 20 | Contributor Meeting + Onboarding Day
Fri 21 | Contributor Meeting
Sat 22 | Contributor Meeting
Sun 23 | Contributor Meeting

Still working on the conference website. The "hackfest" page is this one:

https://github.com/qgis/QGIS/wiki/25th-Contributor-Meeting-in-'s-Hertogenbosch

Kind regards,
Raymond


On 31-12-2022 11:51, Anita Graser wrote:

Hi Raymond,

I'm planning to publish a "Save the date" post (similar to 
https://blog.qgis.org/2022/05/03/save-the-date-qgis-contributor-meeting-in-firenze/ on Jan 2nd. Please let me know if you want to add some particular piece of information.


Regards,
Anita


On Monday, 19. December 2022 11:15:14 (+01:00), Andreas Neumann via 
QGIS-Developer wrote:


Hi Raymond,

This is great news! Looking foward to a great week of QGIS
presentations, meetings, discussions, etc.

Happy to see the continuation of the QGIS user conference after the
COVID break!

Thank you for accepting this challenge with your local team!

Andreas

    On 2022-12-19 11:04, Raymond Nijssen via QGIS-Developer wrote:


Save even more dates!!

Prior to the contributor meeting there will be an International
User Conference on 18 and 19 April. Thursday the 20th is going to
be an onboarding day for newcomers to the hackfest.

Details will follow soon. All six days are going to take place in
the same venue.

Hope many developers and other QGIS badasses will be around for
giving presentations and workshops.

Kind regards,
Raymond



    On 12-12-2022 09:45, Raymond Nijssen via QGIS-Developer wrote:

Dear devs and contrbs,

The next QGIS Contributor Meeting will take place:

20-23 April 2023

in 's-Hertogenbosch, The Netherlands. And it's very very likely
that there will be an International User Conference the 2 days
prior to the meeting (18+19 April). Details will follow. Please
save these dates.

https://github.com/qgis/QGIS/wiki/25th-Contributor-Meeting-in-

<https://github.com/qgis/QGIS/wiki/25th-Contributor-Meeting-in->'s-Hertogenbosch

Kind regards,
Raymond
___
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
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>
Unsubscribe:
https://lists.osgeo.org/mailman/listinfo/qgis-developer
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>

___
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
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>
Unsubscribe:
https://lists.osgeo.org/mailman/listinfo/qgis-developer
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>




--
Anita Graser
Home: http://anitagraser.com
Twitter: @underdarkgis
Mastodon: @underdark...@fosstodon.org

___
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] Save the dates - Contributor Meeting 2023

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

Save even more dates!!

Prior to the contributor meeting there will be an International User 
Conference on 18 and 19 April. Thursday the 20th is going to be an 
onboarding day for newcomers to the hackfest.


Details will follow soon. All six days are going to take place in the 
same venue.


Hope many developers and other QGIS badasses will be around for giving 
presentations and workshops.


Kind regards,
Raymond



On 12-12-2022 09:45, Raymond Nijssen via QGIS-Developer wrote:

Dear devs and contrbs,

The next QGIS Contributor Meeting will take place:

20-23 April 2023

in 's-Hertogenbosch, The Netherlands. And it's very very likely that 
there will be an International User Conference the 2 days prior to the 
meeting (18+19 April). Details will follow. Please save these dates.


https://github.com/qgis/QGIS/wiki/25th-Contributor-Meeting-in-'s-Hertogenbosch

Kind regards,
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


Re: [QGIS-Developer] Save the dates - Contributor Meeting 2023

2022-12-12 Thread Raymond Nijssen via QGIS-Developer
Thank you Anita. When the conference details are clear and the 
conference website is online, could there also be an item in the news 
feed in QGIS?



On 12-12-2022 20:19, Anita Graser wrote:

Thank you for the update, Raymond.

I've added the event to the news feed for the website:
https://github.com/qgis/QGIS-Website/blob/master/source/feeds/qugsnews.atom

For anyone else planning events: please feel invited to add your events to
this news feed as well.

Regards,
Anita


On Monday, 12. December 2022 09:45:15 (+01:00), Raymond Nijssen via
QGIS-Developer wrote:


 > Dear devs and contrbs,

 >

 > The next QGIS Contributor Meeting will take place:

 >

 > 20-23 April 2023

 >

 > in 's-Hertogenbosch, The Netherlands. And it's very very likely that
there will be an International User Conference the 2 days prior to the
meeting (18+19 April). Details will follow. Please save these dates.

 >

 >
https://github.com/qgis/QGIS/wiki/25th-Contributor-Meeting-in-'s-Hertogenbosch






 > Kind regards,

 > 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

 >

--
Anita Graser
Home: http://anitagraser.com
Twitter: @underdarkgis
Mastodon: @underdark...@fosstodon.org

___
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] Save the dates - Contributor Meeting 2023

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

Dear devs and contrbs,

The next QGIS Contributor Meeting will take place:

20-23 April 2023

in 's-Hertogenbosch, The Netherlands. And it's very very likely that 
there will be an International User Conference the 2 days prior to the 
meeting (18+19 April). Details will follow. Please save these dates.


https://github.com/qgis/QGIS/wiki/25th-Contributor-Meeting-in-'s-Hertogenbosch

Kind regards,
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


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 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


[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] createvectorTable error: Could not retrieve driver for connection

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

Thanks Nyall, will try this today!

Raymond



On 05-12-2022 00:53, Nyall Dawson wrote:

On Fri, 2 Dec 2022 at 23:05, Richard Duivenvoorde via QGIS-Developer
 wrote:


Ok, I think I found the crux!

With your code QGIS 3.26 will CREATE a new geopackage... (if it is not there 
yet)
After which QGIS master is fine

BUT QGIS master apparently does NOT create a new geopackage with your code...
So IF there is an excisting test.gpkg, all is fine
IF there is not one, it depends on you QGIS version if it creates a fresh one 
or not?

Maybe some core dev can say something about this?


I'd say the old behaviour was an unintentional bug, and that
createConnection should only be used with a path that already exists.

For 3.28 and later you can create empty databases using
QgsProviderMetadata.createDatabase(uri), eg:

QgsProviderRegistry.instance().providerMetadata('ogr').createDatabase('/path/to/data.gpkg')

After that you can create a connection to the db using createConnection safely.

Nyall





Regards,

Richard Duivenvoorde

On 12/2/22 13:53, Richard Duivenvoorde via QGIS-Developer wrote:

Hi Raymond,

I've updated your test script a little:

gpkg_fn = '/tmp/test.gpkg'
try:
  print(QgsProviderRegistry.instance().providerList())
  md = QgsProviderRegistry.instance().providerMetadata('ogr')
  print(f'md = {md}')
  conn = md.createConnection(gpkg_fn, {})
  print(f'conn = {conn}')
  fields = QgsFields()
  fields.append(QgsField('key', QVariant.String))
  fields.append(QgsField('value', QVariant.String))
  conn.createVectorTable('', 'test', fields, QgsWkbTypes.NoGeometry, 
QgsCoordinateReferenceSystem(), True, {})
except Exception as e:
  print(f'ERROR: {e}')

As said: in my freshly compiled master, this fails to run with 'Could not 
retrieve driver for connection'
It also fails on my 3.28.0 version I have in a Windows VM.

It DOES print the 'ogr' driver in the providerList() though.

Strange behaviour: after starting (the older compiled) Qgis 3.26 on the same 
Linux system (in 3.26 the script always seems to work...) QGIS master ALSO 
works!!!

So I thought it had something todo with loading different provider registries 
or so?
Maybe master not having something but after starting 3.26 it was there?
Or is it loading (different) gdal/ogr libs order?
Did something change there?

Looking that the createConnection docs:
https://qgis.org/pyqgis/master/core/QgsConnectionRegistry.html#qgis.core.QgsConnectionRegistry.createConnection
I thought to see that your 'id' was only the filename, but adding ogr:// in 
front of it does not even work...
So not sure if that createConnection doc is old, or if I'm looking in the wrong 
createConnection...

Anybody can





On 12/2/22 12:30, Raymond Nijssen via QGIS-Developer wrote:

No one having a clue? Should I create an issue?

Raymond


On 30-11-2022 18:08, Raymond Nijssen via QGIS-Developer wrote:

Hi developers,

Recently some users of my plugin started getting errors in the code that 
creates a .gpkg file with a table. I wrote a piece of test code:

gpkg_fn = '/home/raymond/tmp/test.gpkg'
md = QgsProviderRegistry.instance().providerMetadata('ogr')
conn = md.createConnection(gpkg_fn, {})
fields = QgsFields()
fields.append(QgsField('key', QVariant.String))
fields.append(QgsField('value', QVariant.String))
conn.createVectorTable('', 'test', fields, QgsWkbTypes.NoGeometry, 
QgsCoordinateReferenceSystem(), True, {})


That last line *sometimes* results in this error:

_core.QgsProviderConnectionException: Could not retrieve driver for connection



I cannot reproduce the error on my laptop (Linux), but Richard tried a few QGIS 
versions in both Windows and Linux and *sometimes* got the error and sometimes 
not. Even in the same application, the error disappeared after running another 
version of QGIS simultaneously... :/

No clue if this error is GDAL or Qt or whatever related, pretty puzzling for 
me. Hope anyone can help!

Kind regards,
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 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] createvectorTable error: Could not retrieve driver for connection

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

No one having a clue? Should I create an issue?

Raymond


On 30-11-2022 18:08, Raymond Nijssen via QGIS-Developer wrote:

Hi developers,

Recently some users of my plugin started getting errors in the code that 
creates a .gpkg file with a table. I wrote a piece of test code:


gpkg_fn = '/home/raymond/tmp/test.gpkg'
md = QgsProviderRegistry.instance().providerMetadata('ogr')
conn = md.createConnection(gpkg_fn, {})
fields = QgsFields()
fields.append(QgsField('key', QVariant.String))
fields.append(QgsField('value', QVariant.String))
conn.createVectorTable('', 'test', fields, QgsWkbTypes.NoGeometry, 
QgsCoordinateReferenceSystem(), True, {})



That last line *sometimes* results in this error:

_core.QgsProviderConnectionException: Could not retrieve driver for 
connection




I cannot reproduce the error on my laptop (Linux), but Richard tried a 
few QGIS versions in both Windows and Linux and *sometimes* got the 
error and sometimes not. Even in the same application, the error 
disappeared after running another version of QGIS simultaneously... :/


No clue if this error is GDAL or Qt or whatever related, pretty puzzling 
for me. Hope anyone can help!


Kind regards,
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] createvectorTable error: Could not retrieve driver for connection

2022-11-30 Thread Raymond Nijssen via QGIS-Developer

Hi developers,

Recently some users of my plugin started getting errors in the code that 
creates a .gpkg file with a table. I wrote a piece of test code:


gpkg_fn = '/home/raymond/tmp/test.gpkg'
md = QgsProviderRegistry.instance().providerMetadata('ogr')
conn = md.createConnection(gpkg_fn, {})
fields = QgsFields()
fields.append(QgsField('key', QVariant.String))
fields.append(QgsField('value', QVariant.String))
conn.createVectorTable('', 'test', fields, QgsWkbTypes.NoGeometry, 
QgsCoordinateReferenceSystem(), True, {})



That last line *sometimes* results in this error:

_core.QgsProviderConnectionException: Could not retrieve driver for 
connection




I cannot reproduce the error on my laptop (Linux), but Richard tried a 
few QGIS versions in both Windows and Linux and *sometimes* got the 
error and sometimes not. Even in the same application, the error 
disappeared after running another version of QGIS simultaneously... :/


No clue if this error is GDAL or Qt or whatever related, pretty puzzling 
for me. Hope anyone can help!


Kind regards,
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


Re: [QGIS-Developer] Best way to import gdal, ogr, osr ?

2022-10-17 Thread Raymond Nijssen via QGIS-Developer
Thank you Even. And that will always be available in QGIS? Without any 
extra (gdal) installations?


Let's say, I'm buying a brand new Windows laptop and install QGIS with 
the standalone installer, I can type


from osgeo import ogr

in the python console and it will just work?

Sorry, this is a bit hard to verify as I'm not wanting to buy a new 
Windows laptop :)



On 17-10-2022 11:51, Even Rouault wrote:

You can just use

from osgeo import ogr
from osgeo import gdal
from osgeo import osr

That will work with any GDAL version of the last 15 years or so.

Le 17/10/2022 à 10:52, Raymond Nijssen via QGIS-Developer a écrit :

Dear developers,

What is the best way to import ogr, gdal and osr in my pyqgis script?


This used to work in older QGIS versions:

import gdal
import ogr
import osr



Now I've changed that to:

try:
    import ogr
    import gdal
    import osr
except ModuleNotFoundError:
    from osgeo import ogr
    from osgeo import gdal
    from osgeo import osr


But it's still unclear to me what would be the way to make sure my 
script will run in anyone else's installation (Different OS and QGIS 
version).



Maybe there's something like this:

from qgis import ogr

???


Kind regards,
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] Best way to import gdal, ogr, osr ?

2022-10-17 Thread Raymond Nijssen via QGIS-Developer

Dear developers,

What is the best way to import ogr, gdal and osr in my pyqgis script?


This used to work in older QGIS versions:

import gdal
import ogr
import osr



Now I've changed that to:

try:
import ogr
import gdal
import osr
except ModuleNotFoundError:
from osgeo import ogr
from osgeo import gdal
from osgeo import osr


But it's still unclear to me what would be the way to make sure my 
script will run in anyone else's installation (Different OS and QGIS 
version).



Maybe there's something like this:

from qgis import ogr

???


Kind regards,
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


Re: [QGIS-Developer] import 3d or _3d in python?

2022-10-04 Thread Raymond Nijssen via QGIS-Developer

Done:
https://github.com/qgis/pyqgis/issues/97

Raymond



On 03-10-2022 10:24, Martin Dobias wrote:

Hi Raymond

The general idea is that for every PyQGIS module (e.g. "core") there is 
a compiled python module (e.g. _core.so) and a directory acting as a 
module ("core") which imports the compiled module and adds some extra 
functionality (docstrings and more). So normally one wants to use import 
qgis.core instead of qgis._core.


Now with the 3d module things are not so great, because "3d" is not a 
valid module name because of the leading digit, so import qgis.3d simply 
won't work. There are some ways to work it around [1], but I wouldn't 
recommend using them. But as stated earlier, importing qgis._3d should 
generally do the job.


It is probably worth creating a ticket to address this, but I am not 
sure how to best fix it - probably the whole module should be renamed so 
avoid the leading digit - e.g. "threed"


[1] 
https://stackoverflow.com/questions/9090079/in-python-how-to-import-filename-starts-with-a-number 
<https://stackoverflow.com/questions/9090079/in-python-how-to-import-filename-starts-with-a-number>


Cheers
Martin


On Mon, Oct 3, 2022 at 8:58 AM Raymond Nijssen via QGIS-Developer 
mailto:qgis-developer@lists.osgeo.org>> 
wrote:



While trying to import a 3D class in a python script, I found out that
the code in the pyqgis docs is not working (for me):

from qgis.3d import QgsLayoutItem3DMap


Instead I need to add an underscore for the 3d module name:

from qgis._3d import QgsLayoutItem3DMap



Should this be fixed in the documentation? I'm not all sure, cause when
trying to fix it, I found this related commit:


https://github.com/qgis/pyqgis/commit/1ac564790aa0b7abbd003c04d07358d8e4f14493

<https://github.com/qgis/pyqgis/commit/1ac564790aa0b7abbd003c04d07358d8e4f14493>



This is the page in the docs:
https://qgis.org/pyqgis/master/3d/QgsLayoutItem3DMap.html
<https://qgis.org/pyqgis/master/3d/QgsLayoutItem3DMap.html>


Should I make an issue? It took me a while to figure out that _3d
solution.

Cheers,
Raymond
___
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
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
<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] import 3d or _3d in python?

2022-10-03 Thread Raymond Nijssen via QGIS-Developer

Hi Andrea,

I know, but my script is not running in the console. It is part of a 
plugin, so I need to do the import. Would be handy if the documentation 
tells me how to do it.


Kind regards,
Raymond


On 03-10-2022 09:02, Andrea Giudiceandrea via QGIS-Developer wrote:

Il 03/10/2022 08:57, Raymond Nijssen via QGIS-Developer ha scritto:


Instead I need to add an underscore for the 3d module name:

from qgis._3d import QgsLayoutItem3DMap


In the Python console, the 3d library is automatically imported (if QGIS 
is compiled with 3d support) with:


from qgis._3d import *

See: 
https://github.com/qgis/QGIS/blob/95e00c50d219b39b2571dd6bff59a1393deb9b6a/python/console/console_sci.py#L59 



Best regards.

Andrea Giudiceandrea
___
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] import 3d or _3d in python?

2022-10-02 Thread Raymond Nijssen via QGIS-Developer



While trying to import a 3D class in a python script, I found out that 
the code in the pyqgis docs is not working (for me):


from qgis.3d import QgsLayoutItem3DMap


Instead I need to add an underscore for the 3d module name:

from qgis._3d import QgsLayoutItem3DMap



Should this be fixed in the documentation? I'm not all sure, cause when 
trying to fix it, I found this related commit:


https://github.com/qgis/pyqgis/commit/1ac564790aa0b7abbd003c04d07358d8e4f14493



This is the page in the docs:
https://qgis.org/pyqgis/master/3d/QgsLayoutItem3DMap.html


Should I make an issue? It took me a while to figure out that _3d solution.

Cheers,
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


Re: [QGIS-Developer] Re-add Georeferencer action to raster menu?

2022-09-27 Thread Raymond Nijssen via QGIS-Developer

Hi Nyall,

I remember getting confused too. When searching for it, the things I 
tried were typing "georef" in the locator bar, in the processing toolbox 
(filter) and in the plugin manager. Not finding anything anywhere there. 
Maybe it would be possible to make that work?


For example all the menu items showing up in the locator?

Kind regards,
Raymond


On 27-09-2022 08:40, Nyall Dawson via QGIS-Developer wrote:

Hi devs!

I'm after some wider feedback -- in 3.26 I moved the "Georeferencer"
action from the Raster menu to the "Layers" menu, as the georeferencer
was expanded to support more than just raster layers and it no longer
seemed a logical place to put this action.

But we've seen a lot of confusion and bug reports about the missing
action since this move.

I'm pondering whether we should add a second shortcut to the
georeferncer back into the Raster menu, so that this tool will be
available through either location.

Is this a good idea and helps avoid user confusion? Or a bad one which
causes more UI bloat?

Nyall
___
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] g++ dependency?

2022-09-01 Thread Raymond Nijssen via QGIS-Developer
On a fresh Ubuntu 22.04 I wasn't able to compile QGIS until installing 
g++ as a dependency.


Should I add it to this page?
https://github.com/qgis/QGIS/blob/release-3_22/INSTALL.md

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


Re: [QGIS-Developer] Could the H3 library be included as a core QGIS library

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

Hi Calvin,

FYI, there's also this H3 plugin:
https://plugins.qgis.org/plugins/h3_toolkit/

Raymond


On 25-08-2022 14:08, C Hamilton via QGIS-Developer wrote:
A few months ago I was introduced to the H3 (Hexagonal hierarchical 
geospatial indexing system) library (https://h3geo.org/ 
) and as a part of testing it to see its 
capabilities I included it in my Density Analysis plugin. The library is 
blazing fast in creating a hex grid and in doing a geohash of 
coordinates if you are doing a vector based heatmap like I have done in 
the Density Analysis plugin. I think it would be an asset to have it as 
a core QGIS library. Would there be any interest in including it?


Thanks,

Calvin Hamitlon



___
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] How to get the name for a QgsLayoutDesignerInterface object?

2022-07-29 Thread Raymond Nijssen via QGIS-Developer

Wow, thank you so much, masterLayout() it is!

Raymond

On 29-07-2022 11:42, John Gitau wrote:

Hi Raymond,

For the window title, you can try designer.window().windowTitle().

To get the QgsPrintLayout object, you can try designer.masterLayout() 
which has the .name() method.


Cheers,

John

On Fri, 29 Jul 2022 at 12:04, Raymond Nijssen via QGIS-Developer 
mailto:qgis-developer@lists.osgeo.org>> 
wrote:


Hi developers,

I'm trying to get the name for a layout designer window, which is in a
python variable (designer) of type QgsLayoutDesignerInterface.

designer.layout() returns a QgsLayout object but that class does not
have a .name() function.

The QgsPrintLayout class does have a .name() function but I don't know
how to get a QgsPrintLayout object from my designer.

Anyone?

Kind regards,
Raymond



___
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
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>

--
John Gitau

___
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] How to get the name for a QgsLayoutDesignerInterface object?

2022-07-29 Thread Raymond Nijssen via QGIS-Developer

Hi developers,

I'm trying to get the name for a layout designer window, which is in a 
python variable (designer) of type QgsLayoutDesignerInterface.


designer.layout() returns a QgsLayout object but that class does not 
have a .name() function.


The QgsPrintLayout class does have a .name() function but I don't know 
how to get a QgsPrintLayout object from my designer.


Anyone?

Kind regards,
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


Re: [QGIS-Developer] Add algorithm to an existing provider?

2022-05-13 Thread Raymond Nijssen via QGIS-Developer

Hi Benjamin, thanks for your reply.

I'm not sure how the provider should "save a reference on my algorithm". 
What do you mean?


Some things I tried:


self.provider = TestProvider()
QgsApplication.processingRegistry().addProvider(self.provider)

alg2 = TestAlgorithm2()
alg2.setProvider(self.provider) # Maybe this is "setting a reference??

self.provider.addAlgorithm(alg2)

# Now the provider shows the extra algorithms (but not in the GUI)
print(self.provider.algorithms())

# Attempts to get it in the GUI:
self.provider.refreshAlgorithms()
self.provider.loadAlgorithms()
self.provider.load()


Still no luck!

Regards,
Raymond


On 13-05-2022 09:07, Benjamin Jakimow wrote:

Hi Raymond,

you need to ensure that your provider saves a python reference on your 
TestAlgorithm2() (which you probably already do).
After its set of algorithms has changed (i.e. refresh, addAlgorithm(s) 
etc.) it needs to emit the algorithmsLoaded signal.


Greetings,
Benjamin

On 2022-05-13 08:15, Raymond Nijssen via QGIS-Developer wrote:

Is there a way to add a processing algorithm to an existing provider
using pyqgis?

I have 2 plugins and don't know if they are both installed (or which
one will load first). The both contain processing algorithms and I
want those to end up in the same group.

Documentation is a bit brief on this:

QgsProcessingProvider

Examples show to put the addAlgorithm() function(s) in the
loadAlgorithms() function. Then calling

QgsApplication.processingRegistry().addProvider(provider)

adds the group (=provider?) and the algorithms are in it.



What I want to do is finding the provider if it exists already:

self.provider = QgsApplication.processingRegistry().providerById('test')
if self.provider is None:
    self.provider = RayProvider()

and then:

self.provider.addAlgorithm(TestAlgorithm2())

This doesn't work, neither when doing:

provider.refreshAlgorithms()
provider.load()
provider.loadAlgorithms()
...


I'm currently trial-and-errorring my way through this, but I hope
someone has a hint. Even someone pointing at 2 plugins working like
this would be very welcome!

Kind regards,
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] Add algorithm to an existing provider?

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



Is there a way to add a processing algorithm to an existing provider 
using pyqgis?


I have 2 plugins and don't know if they are both installed (or which one 
will load first). The both contain processing algorithms and I want 
those to end up in the same group.


Documentation is a bit brief on this:

QgsProcessingProvider

Examples show to put the addAlgorithm() function(s) in the 
loadAlgorithms() function. Then calling


QgsApplication.processingRegistry().addProvider(provider)

adds the group (=provider?) and the algorithms are in it.



What I want to do is finding the provider if it exists already:

self.provider = QgsApplication.processingRegistry().providerById('test')
if self.provider is None:
self.provider = RayProvider()

and then:

self.provider.addAlgorithm(TestAlgorithm2())

This doesn't work, neither when doing:

provider.refreshAlgorithms()
provider.load()
provider.loadAlgorithms()
...


I'm currently trial-and-errorring my way through this, but I hope 
someone has a hint. Even someone pointing at 2 plugins working like this 
would be very welcome!


Kind regards,
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


Re: [QGIS-Developer] Unexpected results from GPKG table query using executeSql()

2022-04-06 Thread Raymond Nijssen via QGIS-Developer

Hi Alessandro,

Thanks for looking into this!
My QGIS-master + GDAL 3.0.4 returns the same result for that query.


But in QGIS-master, when I try:

q = 'SELECT *, edit_id FROM soilexc_edits ORDER BY edit_id'

I get:
[0, 1, PyQt5.QtCore.QDateTime(2022, 3, 1, 0, 0), 'test1', True]
[1, 2, PyQt5.QtCore.QDateTime(2022, 3, 2, 0, 0), 'test2', True]
[2, 3, PyQt5.QtCore.QDateTime(2022, 3, 3, 0, 0), 'test3', True]

I would expect:
[0, PyQt5.QtCore.QDateTime(2022, 3, 1, 0, 0), 'test1', True, 0]



The point is I'm building a plugin that should work in multiple QGIS 
versions (from 3.10), so I'm trying to write queries that will work for 
any version and that seems very hard.


For now the edit_id+0 workaround does the trick.

BTW, Another thing I bumped into is the QDateTime in the result always 
having the time 00:00. Is that some known limitation?


Kind regards,
Raymond


On 06-04-2022 10:14, Alessandro Pasotti wrote:

Hi Raymond,

I tested your samples and I cannot reproduce the issue on QGIS master 
and GDAL 3.4.


Here is the result of my query on your test file:

In [13]: md = QgsProviderRegistry.instance().providerMetadata('ogr')
     ...: conn = 
md.createConnection('/home/x/Scaricati/soilext_db.gpkg', {})

     ...:
     ...: # Would expect this to return 4 columns: edit_id, timestamp, 
name, can_undo

     ...: q = 'SELECT * FROM soilexc_edits ORDER BY edit_id'
     ...: qr = conn.executeSql(q)
     ...:
     ...:
     ...: # This does not return the edit_id field (Which is the PK)
     ...: for rec in qr:
     ...:     print(rec)
     ...: '''
     ...: [PyQt5.QtCore.QDateTime(2022, 3, 1, 0, 0), '', True]
     ...: [PyQt5.QtCore.QDateTime(2022, 3, 2, 0, 0), '', True]
     ...: [PyQt5.QtCore.QDateTime(2022, 3, 3, 0, 0), '', True]
     ...: '''
[1, PyQt5.QtCore.QDateTime(2022, 3, 1, 0, 0), '', True]
[2, PyQt5.QtCore.QDateTime(2022, 3, 2, 0, 0), '', True]
[3, PyQt5.QtCore.QDateTime(2022, 3, 3, 0, 0), '', True]
[4, PyQt5.QtCore.QDateTime(2022, 3, 30, 0, 0), 'purge', False]
[5, PyQt5.QtCore.QDateTime(2022, 3, 31, 0, 0), 'test_new', True]
[6, PyQt5.QtCore.QDateTime(2022, 3, 31, 0, 0), 'test_new', True]
[7, PyQt5.QtCore.QDateTime(2022, 3, 31, 0, 0), 'test_new', True]
[8, PyQt5.QtCore.QDateTime(2022, 3, 31, 0, 0), 'test_new', True]

the edit_id is actually in the results.

Cheers


On Fri, Apr 1, 2022 at 8:28 AM Raymond Nijssen <mailto:r.nijs...@terglobo.nl>> wrote:


For a workaround I found that selecting this way:

SELECT
    edit_id + 0 AS edit_id,
    timestamp,
    name
FROM
    ...

The +0 seem to makes QGIS (or GDAL?) unaware of edit_id being the PK
field and it does return it. Works both in 3.10 and 3.25.

Raymond



On 31-03-2022 18:15, Alessandro Pasotti wrote:
 > Hi Raymond,
 >
 > your code looks good.
 >
 > Can you provide a test file?
 >
 > There are some test in core here:
 >

https://github.com/qgis/QGIS/blob/master/tests/src/python/test_qgsproviderconnection_ogr_gpkg.py

<https://github.com/qgis/QGIS/blob/master/tests/src/python/test_qgsproviderconnection_ogr_gpkg.py>

 >

<https://github.com/qgis/QGIS/blob/master/tests/src/python/test_qgsproviderconnection_ogr_gpkg.py

<https://github.com/qgis/QGIS/blob/master/tests/src/python/test_qgsproviderconnection_ogr_gpkg.py>>
 >
 >
 > On Thu, Mar 31, 2022 at 6:09 PM Raymond Nijssen via QGIS-Developer
 > mailto:qgis-developer@lists.osgeo.org>
<mailto:qgis-developer@lists.osgeo.org
<mailto:qgis-developer@lists.osgeo.org>>>
 > wrote:
 >
 >     Hi devs,
 >
 >     I'm working on a plugin that connects to a custom table (without
 >     geometry) in a GPKG. When I'm sending queries to it, I keep
on getting
 >     unexpected results. Somehow the id field is missing, sometimes it
 >     appears twice (!). And this seems to be different between
QGIS 3.10 and
 >     3.25. (I think it changed since 3.22).
 >
 >     Here is a piece of my code:
 >
 >
 >     fn = '/path/to/test.gpkg'
 >     md = QgsProviderRegistry.instance().providerMetadata('ogr')
 >     conn = md.createConnection(fn, {})
 >
 >     q = 'select * from test_table;'
 >     qr = conn.executeSql(q)
 >     print(qr) # No id field in result
 >
 >
 >
 >     Before diving into the QGIS code I'd like to check if this is the
 >     way to
 >     go. Or should i use another way to query that GPKG (SQLite) db?
 >
 >
 >  

Re: [QGIS-Developer] Unexpected results from GPKG table query using executeSql()

2022-03-31 Thread Raymond Nijssen via QGIS-Developer

For a workaround I found that selecting this way:

SELECT
  edit_id + 0 AS edit_id,
  timestamp,
  name
FROM
  ...

The +0 seem to makes QGIS (or GDAL?) unaware of edit_id being the PK 
field and it does return it. Works both in 3.10 and 3.25.


Raymond



On 31-03-2022 18:15, Alessandro Pasotti wrote:

Hi Raymond,

your code looks good.

Can you provide a test file?

There are some test in core here: 
https://github.com/qgis/QGIS/blob/master/tests/src/python/test_qgsproviderconnection_ogr_gpkg.py 
<https://github.com/qgis/QGIS/blob/master/tests/src/python/test_qgsproviderconnection_ogr_gpkg.py>



On Thu, Mar 31, 2022 at 6:09 PM Raymond Nijssen via QGIS-Developer 
mailto:qgis-developer@lists.osgeo.org>> 
wrote:


Hi devs,

I'm working on a plugin that connects to a custom table (without
geometry) in a GPKG. When I'm sending queries to it, I keep on getting
unexpected results. Somehow the id field is missing, sometimes it
appears twice (!). And this seems to be different between QGIS 3.10 and
3.25. (I think it changed since 3.22).

Here is a piece of my code:


fn = '/path/to/test.gpkg'
md = QgsProviderRegistry.instance().providerMetadata('ogr')
conn = md.createConnection(fn, {})

q = 'select * from test_table;'
qr = conn.executeSql(q)
print(qr) # No id field in result



Before diving into the QGIS code I'd like to check if this is the
way to
go. Or should i use another way to query that GPKG (SQLite) db?


Kind regards,
Raymond
___
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
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>



--
Alessandro Pasotti
QCooperative: www.qcooperative.net <https://www.qcooperative.net>
ItOpen: www.itopen.it <http://www.itopen.it>

___
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] Unexpected results from GPKG table query using executeSql()

2022-03-31 Thread Raymond Nijssen via QGIS-Developer

Hi Alessandro,

Thanks for your reply. Will share data and a test script with you privately.

Raymond


On 31-03-2022 18:15, Alessandro Pasotti wrote:

Hi Raymond,

your code looks good.

Can you provide a test file?

There are some test in core here: 
https://github.com/qgis/QGIS/blob/master/tests/src/python/test_qgsproviderconnection_ogr_gpkg.py 
<https://github.com/qgis/QGIS/blob/master/tests/src/python/test_qgsproviderconnection_ogr_gpkg.py>



On Thu, Mar 31, 2022 at 6:09 PM Raymond Nijssen via QGIS-Developer 
mailto:qgis-developer@lists.osgeo.org>> 
wrote:


Hi devs,

I'm working on a plugin that connects to a custom table (without
geometry) in a GPKG. When I'm sending queries to it, I keep on getting
unexpected results. Somehow the id field is missing, sometimes it
appears twice (!). And this seems to be different between QGIS 3.10 and
3.25. (I think it changed since 3.22).

Here is a piece of my code:


fn = '/path/to/test.gpkg'
md = QgsProviderRegistry.instance().providerMetadata('ogr')
conn = md.createConnection(fn, {})

q = 'select * from test_table;'
qr = conn.executeSql(q)
print(qr) # No id field in result



Before diving into the QGIS code I'd like to check if this is the
way to
go. Or should i use another way to query that GPKG (SQLite) db?


Kind regards,
Raymond
___
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
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
<https://lists.osgeo.org/mailman/listinfo/qgis-developer>



--
Alessandro Pasotti
QCooperative: www.qcooperative.net <https://www.qcooperative.net>
ItOpen: www.itopen.it <http://www.itopen.it>

___
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] Unexpected results from GPKG table query using executeSql()

2022-03-31 Thread Raymond Nijssen via QGIS-Developer

Hi devs,

I'm working on a plugin that connects to a custom table (without 
geometry) in a GPKG. When I'm sending queries to it, I keep on getting 
unexpected results. Somehow the id field is missing, sometimes it 
appears twice (!). And this seems to be different between QGIS 3.10 and 
3.25. (I think it changed since 3.22).


Here is a piece of my code:


fn = '/path/to/test.gpkg'
md = QgsProviderRegistry.instance().providerMetadata('ogr')
conn = md.createConnection(fn, {})

q = 'select * from test_table;'
qr = conn.executeSql(q)
print(qr) # No id field in result



Before diving into the QGIS code I'd like to check if this is the way to 
go. Or should i use another way to query that GPKG (SQLite) db?



Kind regards,
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


Re: [QGIS-Developer] Possible Contributor Meeting in April 2022

2022-03-30 Thread Raymond Nijssen via QGIS-Developer

Dear community,

Seems too short time for most people to attend a contributor meeting 
this April. We counted about 10 people only, mostly from The 
Netherlands. Therefore we decided to postpone again with one year, until 
spring 2023.


Meanwhile we will host a "hackday" on Friday April 29, 2022. We have 
capacity for 20 people so, if you are willing to gather and contribute 
to the project.. run and save your spot by registering your name on the 
wiki page:


https://github.com/qgis/QGIS/wiki/24th-Contributor-Meeting-in-'s-Hertogenbosch

Hope to see you soon!

Raymond


On 18-03-2022 16:12, Raymond Nijssen via QGIS-Developer wrote:

We are happy to announce the opportunity to host the postponed 2020 QGIS
Contributor Meeting in 's-Hertogenbosch, The Netherlands.

We have 2 options in the last weeks of April 2022. Because this is so soon
we'd like to know how many contributors would be able to attend. Would you
please fill out the form on github wiki page:

https://github.com/qgis/QGIS/wiki/24th-Contributor-Meeting-in-'s-Hertogenbosch#spring-2022-meeting

Hope this will happen, really looking forward to meet you all in person
again!

Kind regards,
Rosa, Aron, 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] Possible Contributor Meeting in April 2022

2022-03-18 Thread Raymond Nijssen via QGIS-Developer
We are happy to announce the opportunity to host the postponed 2020 QGIS
Contributor Meeting in 's-Hertogenbosch, The Netherlands.

We have 2 options in the last weeks of April 2022. Because this is so soon
we'd like to know how many contributors would be able to attend. Would you
please fill out the form on github wiki page:

https://github.com/qgis/QGIS/wiki/24th-Contributor-Meeting-in-'s-Hertogenbosch#spring-2022-meeting

Hope this will happen, really looking forward to meet you all in person
again!

Kind regards,
Rosa, Aron, 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