Bug report #13152
QgsRubberBand not displaying holes in geometry
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | - | ||
Affected QGIS version: | 2.10.0 | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 21215 |
Description
Adding a geometry from a shapefile to QgsRubberBand does not displays holes in the original geometry (holes are filled).
For testing, try the following code with the attached shapefile.
from qgis.core import * from qgis.gui import * canvas = qgis.utils.iface.mapCanvas() cLayer = canvas.currentLayer() rbbrBndPol = QgsRubberBand(canvas, 2) f = QgsFeature() fR = QgsFeatureRequest().setFilterFid(0) f = cLayer.getFeatures(fR) f = f.next() rbbrBndPol.addGeometry(f.geometry(), cLayer)
Thank you
History
#1 Updated by Matthias Kuhn over 9 years ago
- Status changed from Open to Closed
This is by design. The rubberband is the kind of tool you would use to draw a hole into an existing polygon.
You can use QgsHighlight instead.
#2 Updated by Luca Congedo over 9 years ago
Sorry for the noise.
Thank you very much for the link.
Cheers