[QGIS-Developer] AFS feature iterator logic

pathmapper pathmapper at posteo.de
Thu Dec 29 01:40:52 PST 2022


Hi Alex,

with WFS, if the option "Only request features overlapping the view 
extent" is checked,
there will be GetFeature emitted constantly on pan/zoom of the map.

This behaviour doesn't even stop when all features of the service are 
already loaded:
https://github.com/qgis/QGIS/issues/51168

So it looks like currently caching is based only on the request URL 
which doesn't help here much
because the URL changes all the time when zooming/panning because the 
extent parameter
is most of the time a bit different.

You could try the "extractbyextent" processing alg with the arcgisrest 
as input (browse for layer)
and the current map canvas extent as extent.

This works for WFS to avoid producing so much traffic.

Cheers,
Björn



On 28.12.2022 19:32, Alexis R.L. via QGIS-Developer wrote:
> Greetings,
> 
> I'm looking into the web service data fetching and I noticed that
> there are some things that seemed strange at first glance and wanted
> to know if someone had insight into things.
> 
> From what I understand data is fetched and cached and on the initial
> fetch it seems that all the data is fetched? This may be to fill up
> the data cache.
> 
> In the instances where an extent is present in the feature request,
> the extent is used to perform check during the iteration, at each step
> it seems that all the feature ids within the extent are requested,
> (see
> https://github.com/qgis/QGIS/blob/693422bdc010713d4d15a1af6d0c04cc6a2e913d/src/providers/arcgisrest/qgsafsfeatureiterator.cpp#L131
> [1] ) instead of being consolidated once with the requested Ids at the
> start?
> 
> In some cases during the test I am zoomed on two feature but there is
> a request for an extent that return nearly 50 ids, I'm not sure what
> is firing this as I didn't change the extent nor did any manipulation.
> 
> I'm not sure if things are similar for WFS but that stood out to me
> and I don't understand too much why so much data may be requested,
> this is mostly since I'm looking into ways to generate smaller index
> based only on the extent of the canvas, as I think that it may be
> possible to avoid indexing entire web layers if only a fraction of
> them are needed for snapping during data manipulation.
> 
> Cheers,
> 
> Alex
> 
> Links:
> ------
> [1]
> https://github.com/qgis/QGIS/blob/693422bdc010713d4d15a1af6d0c04cc6a2e913d/src/providers/arcgisrest/qgsafsfeatureiterator.cpp#L131
> 
> _______________________________________________
> 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


More information about the QGIS-Developer mailing list