Skip to content

Commit

Permalink
Fix for identify features to select just the shape clicked (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ecuberojimenez authored Jan 27, 2025
1 parent 0935d9f commit da8b78f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions providers/sf_feature_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,19 @@ def fetchFeature(self, f: QgsFeature) -> bool:
_indx = self._index
local_feature: QgsFeature = self._provider._features[_indx]

while (
self._request.filterRect()
and not self._request.filterRect().isNull()
and not local_feature.geometry().intersects(
self._request.filterRect()
)
):
self._index += 1
if self._index >= len(self._provider._features):
f.setValid(False)
return False
local_feature = self._provider._features[self._index]

f.setFields(self._provider.fields())
f.setGeometry(local_feature.geometry())
f.setId(local_feature.id())
Expand Down

0 comments on commit da8b78f

Please sign in to comment.