Re: [QGIS-Developer] Algorithms in python

2021-10-21 Thread Patrick Dunford

I'm writing to support this viewpoint.

I use the XYZ tiles functions in the processing toolbox quite 
extensively and am aware of certain issues in them.


I understood these were written originally in Python as old versions of 
them as such can be found on Github.


Somewhere down the track it is likely I would either start looking at 
these issues and how to correct them, the alternative is to switch to a 
different rendering platform.


I will not be interested in doing this if it cannot be done in Python as 
the differences between the Python development environment and the C one 
are massive.


On 5/10/21 1:26 am, matteo wrote:

Hi devs,

recently I've made a PR to add an algorithm to the core, written in 
python:


https://github.com/qgis/QGIS/pull/44680

from the comments I get that from now on additional algorithms are 
accepted only in C++ and not in python anymore.


Is this an official statement?

My super personal opinion: while I perfectly understand devs position 
on C++, I think we might miss some useful contributions from python 
only devs (like me :) ) and we lack of a "straight" way to add useful 
algorithms to QGIS.


I see 2 options:

* development of Processing plugins with algorithms that can lead to 
many plugins and difficulties to find them
* have a "straight" way to add additional algorithms to QGIS, like the 
"Download scripts from collections" of QGIS 2


What is a general opinion about this topic?

Cheers and thanks

Matteo
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

___
QGIS-Developer 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] Empty vs. Null rectangle, bogus ?

2021-10-21 Thread Sandro Santilli
I've added - in my PR https://github.com/qgis/QGIS/pull/45384 -
a test for QgsRectangle doing this:

  QgsRectangle r1( 0, 0, 0, 0 );
  QVERIFY( ! r1.isNull() );
  QVERIFY( r1.isEmpty() );

  QgsRectangle r2( 1, 1, 1, 1 );
  QVERIFY( ! r2.isNull() );
  QVERIFY( r2.isEmpty() );

The first test fails, the second succeeds.
See
https://cdash.orfeo-toolbox.org/testDetails.php?test=32862378&build=87747

This confirms the confusion in the meaning of "null"

--strk;

On Mon, Oct 18, 2021 at 08:05:22PM +0200, Sandro Santilli wrote:
> Still chasing bug
> QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator
> I reached QgsRectangle, whose "Null" or "Empty" nature changes
> behavior of QgsFeatureVectorFeatureIterator in a way that prevents
> proper WithinDistance filter from working.
> 
> Details are written in
> https://github.com/qgis/QGIS/issues/45352
> but what I wanted to ask here is:
> 
> According to the comments Empty means that some information is still
> available (bounding box of a point) but the unit test for QgsRectangle
> (and the isEmpty method implementation) seem to check for Max < Min,
> which would NOT be the case for the bounding box of a point,
> so is puzzling.
> 
> I'm not sure how to proceed for fixing the bug I'm seeing because
> one simple fix would be avoiding to call setRectangle on a QgsRequest
> if the iterator's mFilterRect is Empty, but a more complex solution
> could be to *allow* those QgsRequests to have multiple filters, rather
> than one excluding the other.
> 
> Also I've yet to understand WHY at construction time a
> QgsAbstractFeatureIterator shoul dhave an Empty rather than Null
> rectangle, which brings back to the first question (is the distinction
> really defined?).
> 
> --strk; 
> 
>   Libre GIS consultant/developer
>   https://strk.kbt.io/services.html
> ___
> 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

-- 

  Libre GIS consultant/developer
  https://strk.kbt.io/services.html
___
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] Empty vs. Null rectangle, bogus ?

2021-10-21 Thread Sandro Santilli
I've filed a PR to change QgsRectangle NULL to NOT include the 0,0,0,0
case. I suspect it will open a can of warms but let me know what do
you think about it:
https://github.com/qgis/QGIS/pull/45607

--strk;

On Thu, Oct 21, 2021 at 10:20:04AM +0200, Sandro Santilli wrote:
> I've added - in my PR https://github.com/qgis/QGIS/pull/45384 -
> a test for QgsRectangle doing this:
> 
>   QgsRectangle r1( 0, 0, 0, 0 );
>   QVERIFY( ! r1.isNull() );
>   QVERIFY( r1.isEmpty() );
> 
>   QgsRectangle r2( 1, 1, 1, 1 );
>   QVERIFY( ! r2.isNull() );
>   QVERIFY( r2.isEmpty() );
> 
> The first test fails, the second succeeds.
> See
> https://cdash.orfeo-toolbox.org/testDetails.php?test=32862378&build=87747
> 
> This confirms the confusion in the meaning of "null"
> 
> --strk;
> 
> On Mon, Oct 18, 2021 at 08:05:22PM +0200, Sandro Santilli wrote:
> > Still chasing bug
> > QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator
> > I reached QgsRectangle, whose "Null" or "Empty" nature changes
> > behavior of QgsFeatureVectorFeatureIterator in a way that prevents
> > proper WithinDistance filter from working.
> > 
> > Details are written in
> > https://github.com/qgis/QGIS/issues/45352
> > but what I wanted to ask here is:
> > 
> > According to the comments Empty means that some information is still
> > available (bounding box of a point) but the unit test for QgsRectangle
> > (and the isEmpty method implementation) seem to check for Max < Min,
> > which would NOT be the case for the bounding box of a point,
> > so is puzzling.
> > 
> > I'm not sure how to proceed for fixing the bug I'm seeing because
> > one simple fix would be avoiding to call setRectangle on a QgsRequest
> > if the iterator's mFilterRect is Empty, but a more complex solution
> > could be to *allow* those QgsRequests to have multiple filters, rather
> > than one excluding the other.
> > 
> > Also I've yet to understand WHY at construction time a
> > QgsAbstractFeatureIterator shoul dhave an Empty rather than Null
> > rectangle, which brings back to the first question (is the distinction
> > really defined?).
> > 
> > --strk; 
___
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 can I make a custom QgsMapCanvasItem visible in the layout?

2021-10-21 Thread Luis Eduardo
I'm working on a plugin that requires the creation of one or more custom 
QgsMapCanvasItem, but I've noticed that they are not visible in the layout.QGIS 
QgsMapCanvasItems like annotations are visible, is it possible to make a custom 
QgsMapCanvasItem visible in the layout?
___
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 can I make a custom QgsMapCanvasItem visible in the layout?

2021-10-21 Thread Luis Eduardo
I'm working on a plugin that requires the creation of one or more custom 
QgsMapCanvasItem, but I've noticed that they are not visible in the layout.QGIS 
QgsMapCanvasItems like annotations are visible, is it possible to make a custom 
QgsMapCanvasItem visible in the layout?
___
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