Deprecated: Return type of Lime\App::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/heraudcoyp/www/admin/lib/Lime/App.php on line 1357

Deprecated: Return type of Lime\App::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/heraudcoyp/www/admin/lib/Lime/App.php on line 1346

Deprecated: Return type of Lime\App::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/heraudcoyp/www/admin/lib/Lime/App.php on line 1342

Deprecated: Return type of Lime\App::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/heraudcoyp/www/admin/lib/Lime/App.php on line 1361

Deprecated: Creation of dynamic property MongoHybrid\MongoLite::$db is deprecated in /home/heraudcoyp/www/admin/lib/MongoHybrid/MongoLite.php on line 20

Deprecated: Return type of MongoLite\Cursor::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/heraudcoyp/www/admin/lib/MongoLite/Cursor.php on line 254

Deprecated: Return type of MongoLite\Cursor::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/heraudcoyp/www/admin/lib/MongoLite/Cursor.php on line 263

Deprecated: Return type of MongoLite\Cursor::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/heraudcoyp/www/admin/lib/MongoLite/Cursor.php on line 259

Deprecated: Return type of MongoLite\Cursor::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/heraudcoyp/www/admin/lib/MongoLite/Cursor.php on line 267

Deprecated: Return type of MongoLite\Cursor::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/heraudcoyp/www/admin/lib/MongoLite/Cursor.php on line 247
Nettoyer le Rubberband de PyQGIS – heraud.co
n°7
Nettoyer le Rubberband de PyQGIS
Qgis, Python
18 nov 2016

Avec PyQGIS on fait souvent appel à l'élément RubberBand en phase de test pour afficher un aperçu de ce que l'on calcule. Le problème c'est qu'il reste affiché d'une exécution du code à l'autre. C'est alors pratique d'une cette fonction, à lancer en début de script, pour nettoyer ces « élastiques » avant chaque nouveau lancement.

def removeRubberbands():
    rbb_items = [ i for i in iface.mapCanvas().scene().items() if issubclass(type(i), qgis.gui.QgsRubberBand)]

    for rbb in rbb_items:
        if rbb in iface.mapCanvas().scene().items():
            iface.mapCanvas().scene().removeItem(rbb)

c. héraud-louisadat

architecte & développeur
67200 Strasbourg
heraud-arobase-laponies-point-fr

*1992, Strasbourg.

Diplômé d'état en 2016 de l'ENSA Paris-Malaquais et de la RWTH Aachen et habilité à maîtrise d'oeuvre en nom propre (HMONP) en 2019, j'ai travaillé pour diverses agences d'architecture à Paris et Berlin puis fait de la recherche en histoire de l'art sur l'architecture Heimatschutz. J'ai fondé l'agence Atkinson-Héraud Architectes en 2023 avec Isabelle Atkinson-Evans. Je développe également des applications pour le Web et la 3D.

Amis, famille et blogroll : Anaïs Héraud-Louisadat, Héraud–Baumann, Till Baumann, Antoine Le Dreff, Station Zéro, BALT.

alsace europe