Changes between Initial Version and Version 1 of Ticket #37179


Ignore:
Timestamp:
Jun 19, 2026, 6:07:21 AM (101 minutes ago)
Author:
wongcht
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #37179 – Description

    initial v1  
    11In `django.contrib.gis.gdal.layer`'s `Layer.__getitem__`, if a layer (with **n** features) **does not support random read**, slicing the layer would call `_make_feature` at most **n** times which this method scan the whole layer until feature id matched.
    22
    3 E.g. Slicing a layer for 3 features (id= 1,2,3) would scan the layer 3 times: [1] for id=1, [1,2] for id=2, [1,2,3] for id=3. Worse case would call `__iter__` (`capi.get_next_feature`) for **n(n+1)/2** times
     3E.g. Slicing a layer for 3 features (id= 1,2,3) would scan the layer 3 times: [1] for id=1, [1,2] for id=2, [1,2,3] for id=3. Worst case would call `__iter__` (`capi.get_next_feature`) for **n(n+1)/2** times
    44
    55A better iteration should scan the layer once only to get all features required. A possible [https://github.com/wongcht/django/pull/2/changes fix] FYR
Back to Top