Skip to content

Instantly share code, notes, and snippets.

View nyalldawson's full-sized avatar

Nyall Dawson nyalldawson

View GitHub Profile
GDAL_DATA=c:\osgeo4w\share\gdal
GDAL_DRIVER_PATH=c:\osgeo4w\bin\gdalplugins
PATH=c:\program files\cmake\bin;C:\cygwin64\bin;C:\OSGeo4W\bin;C:\OSGeo4W\apps\Python36;C:\OSGeo4W\apps\Python36\Scripts;c:\osgeo4w\apps\qt5\bin;C:\OSGeo4W\apps\Python36\sip\PyQt5\;C:\OSGeo4W\apps\Python36\sip;${PATH}
PYTHONHOME=C:\OSGeo4W\apps\Python36
PYTHONPATH=
QGIS_INSTALL_PATH=C:\OSGeo4W\apps\qgis-dev
QML2_IMPORT_PATH=C:\OSGeo4W\apps\Qt5\qml
QT_PLUGIN_PATH=C:\OSGeo4W\apps\qgis-dev\qtplugins;C:\OSGeo4W\apps\Qt5\plugins
@nyalldawson
nyalldawson / gist:5658bbeecb4cbafb8bf484fade49e1cb
Created August 2, 2017 11:39
Setting up prepare commit script using WLS
sudo echo ":WSLInterop:M::MZ::/init:" > /proc/sys/fs/binfmt_misc/register
cd scripts
ln -s qgisstyle.exe qgisstyle
sudo apt-get install flip libyaml-perl libyaml-tiny-perl
c=iface.activeComposers()[0]
c = c.composition()
maps=[i for i in c.items() if i.type()==QgsComposerItem.ComposerMap]
l = iface.activeLayer()
for m in maps:
f = QgsFeature()
f.setFields(l.fields())
f.setAttributes([m.displayName()])