View atlas_exporter
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
from qgis.core import * | |
manager = QgsProject.instance().layoutManager() | |
base_path = os.path.join(QgsProject.instance().homePath()) | |
layout = manager.layoutByName("Planbook") | |
exporter = QgsLayoutExporter(layout) | |
output_format = 'png' | |
exporter.exportToImage(layout.atlas(), base_path, output_format, QgsLayoutExporter.ImageExportSettings()) |
View raster_classifier.py
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 numpy as np | |
from PyQt5.QtCore import QFileInfo | |
import gdal | |
import osr | |
from PyQt5.QtGui import QColor | |
import processing | |
__author__ = 'admire' | |
from qgis.core import QgsRasterShader, QgsColorRampShader, QgsSingleBandPseudoColorRenderer, \ |
View map_grids.py
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
""" | |
Define new functions using @qgsfunction. feature and parent must always be the | |
last args. Use args=-1 to pass a list of values as arguments | |
""" | |
from qgis.core import Qgis, QgsProject,QgsCoordinateTransform,QgsCoordinateReferenceSystem | |
from qgis.gui import * | |
from qgis.utils import qgsfunction, iface | |
def map_bounds(composer_title, map_id): |
View reports.py
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
##Analyis=group | |
##Raster_layers=multiple raster | |
##Composer_template=file | |
##Output_Directory=folder | |
import datetime | |
import os | |
import re | |
from qgis.core import * | |
from qgis.core import ( |
View Dockerfile
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
# Dockerfile to run the cron jobs in root, including python/psycopg2 | |
FROM alpine:edge | |
RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing py-psycopg2 | |
EXPOSE 6000 | |
COPY refresh.py /refresh.py | |
COPY root /var/spool/cron/crontabs/root | |
CMD crond -l 2 -f |