Skip to content

Instantly share code, notes, and snippets.

View m-kuhn's full-sized avatar

Matthias Kuhn m-kuhn

View GitHub Profile
m-kuhn / pyqgis-sip2.rst
Last active December 18, 2015 07:29 — forked from NathanW2/pyqgis-sip2.rst
Minor updates.
View pyqgis-sip2.rst

The QVariant type doesn't exist any more so any methods returning QVariant will be auto converted to Python types. You no longer need to convert the return type using the toXXXX methods.

Remove all:

m-kuhn / atlas.diff
Created November 14, 2014 11:26
Atlas test cleanup
View atlas.diff
diff --git a/tests/src/core/testqgsatlascomposition.cpp b/tests/src/core/testqgsatlascomposition.cpp
index 19b9463..2c3f86c 100644
--- a/tests/src/core/testqgsatlascomposition.cpp
+++ b/tests/src/core/testqgsatlascomposition.cpp
@@ -189,6 +189,17 @@ void TestQgsAtlasComposition::init()
void TestQgsAtlasComposition::cleanup()
+ mAtlasMap->setAtlasDriven( false );
m-kuhn / gist:54950404f47375208b65
Last active August 29, 2015 14:10
QgsMapToPixel / QMatrix4x4
View gist:54950404f47375208b65
QgsMapSettings mapSettings = mMapCanvas->mapSettings();
QMatrix4x4 matrix;
float scaleFactor = mMapCanvas->width() / mapSettings.extent().width();
// The following leads to a slight offset depending on the position on the canvas
// float scaleFactor = 1/mapSettings.mapToPixel().mapUnitsPerPixel();
matrix.scale( scaleFactor, -scaleFactor );
matrix.translate( -mapSettings.extent().xMinimum(), -mapSettings.extent().yMaximum() );
m-kuhn / gist:0f9a29894cde5e1997fa
Created January 26, 2015 13:56
QGIS Docker test
View gist:0f9a29894cde5e1997fa
# QGIS Test
# VERSION 0.0.1
FROM ubuntu:12.04
MAINTAINER Matthias Kuhn <matthias at opengis dot ch>
RUN apt-get update
RUN apt-get install -y bison cmake doxygen flex git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal1-dev libgeos-dev libgsl0-dev libopenscenegraph-dev libosgearth-dev libpq-dev libproj-dev libqscintilla2-dev libqt4-dev libqt4-opengl-dev libqtwebkit-dev libqwt-dev libspatialindex-dev libspatialite-dev libsqlite3-dev lighttpd pkg-config poppler-utils pyqt4-dev-tools python python-dev python-qt4 python-qt4-dev python-sip python-sip-dev spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb clang++-3.4 clang-3.4 make

Keybase proof

I hereby claim:

  • I am m-kuhn on github.
  • I am mkuhn ( on keybase.
  • I have a public key whose fingerprint is E72C DAD4 7F5A 9EFA C87B 5FC8 A0E7 6680 8764 D73F

To claim this, I am signing this object:


How to upload a file to a github release

  • Create the release using the github page

  • Query the github API for the upload URL

    curl -i{releasename}
m-kuhn / # qgis3-dev - 2016-12-01_16-55-44.txt
Created December 2, 2016 13:44
qgis3-dev (qgis/qgisdev/qgis3-dev) on macOS 10.11.6 - Homebrew build logs
View # qgis3-dev - 2016-12-01_16-55-44.txt
Homebrew build logs for qgis/qgisdev/qgis3-dev on macOS 10.11.6
Build date: 2016-12-01 16:55:44
View polys_centroid_ogr_2.2.1.gml
<?xml version="1.0" encoding="utf-8" ?>
View nose2.cfg
plugins = nose2.plugins.logcapture
always-on = True
clear-handlers = True
log-level = NOTSET


The QGIS attribute form currently allows displaying and editing the following things:

  • Attribute editors (highly configurable)
  • Relation editor (for showing children of a feature)

We propose to add a new widget type Charts and drawings Widget to this list. With this new type it will be possible to show graphically appealing and interactive items like charts or technical drawings on the attribute form.

screenshot from 2018-05-08 12-21-44