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
m-kuhn / pyqgis-sip2.rst
Last active December 18, 2015 07:29 — forked from NathanW2/pyqgis-sip2.rst
Minor updates.

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:

toString()
toList()
toInt()
toFloat()
toStringList()
toByteArray()
@m-kuhn
m-kuhn / atlas.diff
Created November 14, 2014 11:26
Atlas test cleanup
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
m-kuhn / gist:54950404f47375208b65
Last active August 29, 2015 14:10
QgsMapToPixel / QMatrix4x4
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
m-kuhn / gist:0f9a29894cde5e1997fa
Created January 26, 2015 13:56
QGIS Docker test
# 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 (https://keybase.io/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 https://api.github.com/repos/opengisch/osgeo4travis/releases/tags/{releasename}
    
@m-kuhn
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
Homebrew build logs for qgis/qgisdev/qgis3-dev on macOS 10.11.6
Build date: 2016-12-01 16:55:44
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=""
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>0.6538461538461539</gml:X><gml:Y>-1</gml:Y></gml:coord>
<gml:coord><gml:X>8</gml:X><gml:Y>5.5</gml:Y></gml:coord>
[unittest]
plugins = nose2.plugins.logcapture
[log-capture]
always-on = True
clear-handlers = True
log-level = NOTSET

Details

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