Skip to content

Commit 640a822

Browse files
committed
fix removing spatial index building from InspectPlanFeatures tool
1 parent 0116c18 commit 640a822

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

arho_feature_template/gui/tools/inspect_plan_features_tool.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from functools import partial
44
from typing import TYPE_CHECKING
55

6-
from qgis.core import QgsFeature, QgsFeatureRequest, QgsPointXY, QgsRectangle, QgsSpatialIndex, QgsVectorLayer
6+
from qgis.core import QgsFeature, QgsFeatureRequest, QgsPointXY, QgsRectangle, QgsVectorLayer
77
from qgis.gui import QgsMapCanvas, QgsMapMouseEvent, QgsMapTool, QgsRubberBand
88
from qgis.PyQt.QtCore import QPoint, Qt, QTimer, pyqtSignal
99
from qgis.PyQt.QtGui import QColor
@@ -24,18 +24,12 @@ def __init__(self, canvas: QgsMapCanvas, layer_classes: list[PlanFeatureLayer]):
2424

2525
self.layer_classes = layer_classes
2626
self.layers = [cls.get_from_project() for cls in layer_classes]
27-
self.spatial_indexes: dict[str, QgsSpatialIndex] = {}
2827

2928
self.highlighted: tuple[QgsFeature, str] | None = None
3029
self.highlight_rubber_band: QgsRubberBand | None = None
3130

3231
def activate(self):
3332
super().activate()
34-
self.rebuild_spatial_indexes()
35-
36-
def rebuild_spatial_indexes(self):
37-
for layer in self.layers:
38-
self.spatial_indexes[layer.id()] = QgsSpatialIndex(layer.getFeatures())
3933

4034
def create_highlight_rubberband(self, feature: QgsFeature, layer: QgsVectorLayer):
4135
self.highlight_rubber_band = QgsRubberBand(self.canvas, layer.geometryType())

0 commit comments

Comments
 (0)