Skip to content

Instantly share code, notes, and snippets.

@ivanbarsukov
ivanbarsukov / display.py
Created August 13, 2025 06:59
QGIS display canvas function for Jupyter Notebook
from PIL import Image as PILImage
from qgis.PyQt.QtGui import QImage
from qgis.core import QgsMapRendererSequentialJob
from qgis.gui import QgsMapCanvas
def display_canvas(canvas: QgsMapCanvas) -> PILImage.Image:
job = QgsMapRendererSequentialJob(canvas.mapSettings())
job.start()
@ivanbarsukov
ivanbarsukov / keybindings.json
Created August 12, 2025 07:54
Jupyter keybindings for VSCode Neovim
[
{
"key": "/",
"when": "notebookEditorFocused && !inputFocus && !notebookOutputInputFocused",
"command": "notebook.find"
},
{
"key": "ctrl+enter",
"when": "!inlineChatVisible && notebookCellListFocused",
"command": "notebook.cell.executeAndFocusContainer"