[QGIS-Developer] point in polygon strikes again: big performance issue

Jorge Gustavo Rocha jgr at di.uminho.pt
Sun Mar 14 17:18:01 PDT 2021


Hi Nyall,

Fully agree with you. There are many ways to do this.

In summary, expressions should be used caution, specially in virtual
fields.

But it is so nice to have expressions in virtual fields able to update
as we edit and move features around. I love it!

Regards,

Jorge
Às 00:01 de 15/03/21, Nyall Dawson escreveu:
> On Mon, 15 Mar 2021 at 09:56, David Strip <qgis-dev at stripfamily.net> wrote:
>>
>> On 3/14/2021 5:34 PM, Jorge Gustavo Rocha wrote:
>>
>> Hi David,
>>
>> Thanks for replication this issue. "Join attributes by location
>> (summary)" is definitely the best choice for this use case. It creates
>> the new layer in a few seconds. That's why I think we are missing
>> something (spatial indexes?, dependency graph?) in the expression engine.
>>
>> There are anomalies in the data. That's almost the same with any dataset
>> we start working with :-)
>>
>> Regards,
>>
>> Jorge
>>
>> I tried a different approach, using aggregate, matching on the country name, thinking that would be faster than a spatial check.
>> I created a new field with the expression:
>>
>> aggregate( '03-03-2021','sum', "Confirmed", "Country_Region" ILIKE attribute(@parent,'SOVEREIGNT'))
>>
>> Much to my surprise, this was slower than "Join attributes by location (summary)"
> 
> As noted previously in this thread, the expression engined isn't
> optimised for this kind of use case, vs the processing algorithms
> which are HEAVILY optimised!
> 
> Like almost everything in GIS, there's many ways to achieve the same
> results and some will work better than others! :D
> 
> Nyall
> 
> 
>>
>> _______________________________________________
>> QGIS-Developer mailing list
>> QGIS-Developer at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

J. Gustavo
-- 
Jorge Gustavo Rocha
Departamento de Informática
Universidade do Minho
4710-057 Braga
Gabinete 3.29 (Piso 3)
Tel: +351 253604480
Fax: +351 253604471
Móvel: +351 910333888
skype: nabocudnosor


More information about the QGIS-Developer mailing list