Skip to content

Instantly share code, notes, and snippets.

View NathanW2's full-sized avatar

Nathan Woodrow NathanW2

  • Chartis Technology/Metrix Assets
  • Australia
View GitHub Profile
sip: Deprecation warning: C:/Users/nathan.woodrow/dev/qgis/python/analysis/analysis.sip:1: %Module version number should be specified using the 'version' argument
sip: Deprecation warning: C:/Users/nathan.woodrow/dev/qgis/python/core/core.sip:1: %Module version number should be specified using the 'version' argument
sip: C:/Users/nathan.woodrow/dev/qgis/python/core/qgsvectorlayercache.sip:14: syntax error
jom: C:\Users\nathan.woodrow\dev\qgis\build2\python\CMakeFiles\python_module_qgis_analysis.dir\build.make [python\analysis\sipanalysispart0.cpp] Error 1
jom: C:\Users\nathan.woodrow\dev\qgis\build2\CMakeFiles\Makefile2 [python\CMakeFiles\python_module_qgis_analysis.dir\all] Error 2
jom: C:\Users\nathan.woodrow\dev\qgis\build2\Makefile [all] Error 2
@ECHO OFF
SET PATH=bin
IF NOT EXIST bin\irssi.exe EXIT
SET PERL5LIB=lib/perl5/5.8
SET TERMINFO_DIRS=terminfo
START irssi.exe %1 %2 %3 %4 %5
diff --git a/python/core/qgspythonrunner.sip b/python/core/qgspythonrunner.sip
index b9a89f6..e71329a 100644
--- a/python/core/qgspythonrunner.sip
+++ b/python/core/qgspythonrunner.sip
@@ -12,6 +12,9 @@ class QgsPythonRunner
/** execute a python statement */
static bool run( QString command, QString messageOnError = QString() );
+ /** Eval a python statement */
+ static bool eval( QString command, QString& result);
x3, y3, x4, y4 = (x1 + dist*(y1-y2) / dn,
y1 - dist*(x1-x2) / dn,
x2 + dist*(y1-y2) / dn,
y2 - dist*(x1-x2) / dn)
from functools import partial
def CreatePoint(x_column, y_column):
def _createpoint(x_column, y_column, feature):
# Look up the feature x and y column
x1, y1 = feature[x_column], feature[y_column]
return "Create from column", x_column, y_column, feature
return partial(_createpoint, x_column, y_column)
@echo off
rem Root OSGEO4W home dir to the same directory this script exists in
set OSGEO4W_ROOT=%~dp0
rem Convert double backslashes to single
set OSGEO4W_ROOT=%OSGEO4W_ROOT:\\=\%
echo. & echo OSGEO4W home is %OSGEO4W_ROOT% & echo.
set PATH=%OSGEO4W_ROOT%\bin;%PATH%
rem Add application-specific environment settings
for feature in vlayer:
rect = feature.geometry().boundingBox()
iface.mapCanvas().setExtent(rect)
iface.mapCanvas().refresh()
for feature in vlayer:
rect = feature.geometry().boundingBox()
iface.mapCanvas().setExtent(rect)
iface.mapCanvas().refresh()
def getFeatures():
if selectedOnly:
return layer.selectedFeatures():
else:
return layer.getFeatures()
def SelectionWidget(QgsEditorWidget):
def createWidget(self):
return QComboBox()
def setValue(self, value):
pass
def retriveValue(self, value):
pass