[QGIS-Developer] Creating a spatial index on a table created with QgsVectorLayerExporter Python function

Jorge Gustavo Rocha jgr at di.uminho.pt
Sun Mar 14 09:45:14 PDT 2021


Hi Bo,

I did the laziest test. I've tried to run 'Create spatial index' on a
Postgresql layer. Result was:

Layer's data provider does not support spatial indexes [1]

Does it help?

I think that things like spatial filters, used on rendering, runs on the
provider side, so QGIS do not need to know about spatial filters.

But I found out that aggregate expressions, for example, seems to run on
QGIS side and do not take advantage of spatial indexes.

Regards,

Jorge

[1] https://nextcloud.geomaster.pt/index.php/s/w38gboTBNsf2pe8

The layer itself is a Postgresql layer with a native gist index. It was
created on the provider site.

Às 12:01 de 14/03/21, Andrea Giudiceandrea escreveu:
> Bo Victor Thomsen wrote
>> # Experiment for getting spatial index. Tried with 1, True ...
>> options = {}
>> options['spatial_index'] = 'on'
> 
> Hi Bo Victor,
> AFAIK it should be:
> 
> options = {}
> options['layerOptions'] = ['SPATIAL_INDEX=YES']
> 
> Regards.
> 
> Andrea
> 
> 
> 
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html
> _______________________________________________
> 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