Look at this existing tutorial https://lerryws.xyz/posts/PyQGIS-in-Jupyter-Notebook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"colorScheme": "Campbell", | |
"commandline": "pwsh.exe -ExecutionPolicy ByPass -NoExit -Command \"& '%USERPROFILE%\\anaconda3\\shell\\condabin\\conda-hook.ps1' ; conda activate '%USERPROFILE%\\anaconda3' \"", | |
"guid": "{e7d34d61-5a57-4f38-8eab-91cb777b0c26}", | |
"hidden": false, | |
"icon": "%USERPROFILE%\\anaconda3\\Menu\\anaconda-navigator.ico", | |
"name": "Anaconda PowerShell Prompt", | |
"startingDirectory": "%USERPROFILE%" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ejemplo de cómo crear capas en QGIS y dotarlas de simbología basada en reglas | |
# Las fuentes en las que me he basado para crearlo son principalmente el QGIS Cookbook, | |
# algún artículo de Anita Grase y otras fuentes como | |
# https://gis.stackexchange.com/questions/86770/how-to-programmatically-set-a-rule-based-renderer-in-qgis | |
# Cuando pueda subir un artículo más detallado a la wiki de qgis | |
# se acompañará de estas fuentes en detalle con enlaces,etc, para referencia y consulta | |
# En mi caso creo una capa por cada una de estas especies de peces, | |
que meto en un diccionario junto al color que tendrá la capa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
import base64 | |
import textwrap | |
def render_svg(svg): | |
"""Renders the given svg string.""" | |
b64 = base64.b64encode(svg.encode('utf-8')).decode("utf-8") | |
html = r'<img src="data:image/svg+xml;base64,%s"/>' % b64 | |
st.write(html, unsafe_allow_html=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
To save python objects of any sort, to a file. | |
''' | |
import pickle as pkl | |
pkl.dump( fig, open('FigureObject.pickle', 'wb') ) | |
pkl.dump( fig, open('FigureObject.pickle', 'wb'), fix_imports=True ) # fix_imports makes it py2x compatible - untested | |
''' | |
Load python objects from file |
Enlaces con otros ficheros compartidos en los comentarios: