Skip to content

Instantly share code, notes, and snippets.

@Gustry
Created April 22, 2021 10:06
Show Gist options
  • Save Gustry/fc13d4c032c14a53bfe2d96709911437 to your computer and use it in GitHub Desktop.
Save Gustry/fc13d4c032c14a53bfe2d96709911437 to your computer and use it in GitHub Desktop.
Debug vector layer within Processing algo
@staticmethod
def debug_layer(context, layer: QgsMapLayer, name=None):
from qgis.core import QgsProcessingContext
if name:
layer.setName(name)
context.temporaryLayerStore().addMapLayer(layer)
context.addLayerToLoadOnCompletion(
layer.id(),
QgsProcessingContext.LayerDetails(
layer.name(),
context.project(),
"JENESAISPASCEQUECEST"
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment