Skip to content

Instantly share code, notes, and snippets.

@Guts
Guts / dev_qgis_plugin_setup.sh
Last active March 28, 2024 10:25
Bash script to quickly set up QGIS to develop a plugin.
#!/bin/sh
set -e
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <git remote> <git local folder>" >&2
echo "Example: $0 git@gitlab.com:Oslandia/qgis/qompligis.git /tmp/qgis_dev" >&2
exit 1
fi
@Guts
Guts / moving_folder_tree.py
Created July 29, 2021 14:07
Move folder with all tree files in Python with pathlib and without shutil
#! python3
import logging
from pathlib import Path
logging.basicConfig(level=logging.DEBUG)
source_dir = Path("/tmp/output_build/")
dest_dir = Path("/deployment/")
@Guts
Guts / .gitignore
Last active July 23, 2021 13:43
Mini RSS Reader in 1h - TP Idgeo
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
@Guts
Guts / geojulien_feeds_subscriptions.opml
Last active November 28, 2023 11:04
Flux RSS exportés depuis Feedly
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Geo subscriptions in feedly Cloud</title>
</head>
<body>
<outline text="GIS (en)" title="GIS (en)">
<outline type="rss" text="gisn8" title="gisn8" xmlUrl="http://www.blogger.com/feeds/1381809465952493828/posts/default" htmlUrl="http://gisn8.blogspot.com/"/>
<outline type="rss" text="Spatiality Blog" title="Spatiality Blog" xmlUrl="http://spatialityblog.com/feed/" htmlUrl="https://spatialityblog.com/"/>
@Guts
Guts / qgis_resources_preview_table.md
Last active April 11, 2024 08:01
Script to convert a remote QRC (Qt Resources Collection files) into markdown to preview images. This example covers QGIS project.

QGIS embedded images

Remember how to use it:

from qgis.core import QgsApplication
from qgis.PyQt.QtGui import QIcon, QPixmap

images

@Guts
Guts / db_connections_new.py
Created January 13, 2021 10:16
QGIS API data provider
import pprint
from functools import partial
from qgis.core import QgsDataSourceUri, QgsProviderRegistry
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QDialog, QComboBox
# variables
db_types = {
# point de vigilance, les noms du type de base de données ne sont pas exactement les mêmes...
@Guts
Guts / cnig_23807.md
Last active September 14, 2020 13:26
Scraper et transformer du HTML en markdown (support article Geotribu)

7 septembre – 19 octobre 2020

Evaluation du partage des Données environnementales sur fond cartographique en Europe.

Un portail en ligne a été créé dans le cadre de la directive INSPIRE pour permettre le partage des données environnementales géolocalisées entre autorités publiques européennes. Cela inclut, par exemple, des normes communes pour la collecte de données sur les eaux souterraines, les réseaux de transport, l’utilisation des sols, ou les températures de l’air…

Cela devrait permettre d’évaluer dans quelle mesure la directive est :
– efficace dans la protection de l’environnement

@Guts
Guts / project-create.sh
Last active March 23, 2020 16:50 — forked from francoisromain/project-create.sh
A bash script to create a Git post-receive hook to deploy after a Git push
#!/bin/bash
# source: https://gist.github.com/francoisromain/58cabf43c2977e48ef0804848dee46c3
# and another script to delete the directories created by this script
# project-delete.sh: https://gist.github.com/francoisromain/e28069c18ebe8f3244f8e4bf2af6b2cb
# Call this file with `bash ./project-create.sh project-name`
# - project-name is mandatory
# This will creates 4 directories and a git `post-receive` hook.
@Guts
Guts / gource_config_isogeo_qgis_plugin.ini
Last active October 30, 2019 17:51
Sample configuration file for Gource
[display]
fullscreen=true
output-framerate=60
output-ppm-stream=./isogeo_qgis_plugin_video_streamed_output.ppm
viewport=1280x720
[gource]
auto-skip-seconds=10
date-format=%d %B %Y
disable-progress=true
@Guts
Guts / qgis_deploy_install_upgrade_ltr.ps1
Last active February 23, 2024 19:19
Use OSGeo4W installer command-line abilities to provide a real-life example like downloading and installing QGIS LTR full meta-package
#Requires -RunAsAdministrator
<#
.Synopsis
Download the OSGeo4W installer then download and install QGIS LTR (through the 'full' meta-package).
.DESCRIPTION
This script will:
1. change the current directory to the user downloads folder
2. download the OSGeo4W installer
3. launch it passing command-line parameters to DOWNLOAD packages required to QGIS LTR FULL