This file contains hidden or 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
def h(): | |
print "h" | |
h() |
This file contains hidden or 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 sys | |
from PyQt4.QtCore import * | |
from PyQt4.QtGui import * | |
from PyQt4.Qsci import QsciScintilla, QsciLexerPython | |
import os | |
import os.path | |
class Editor(QsciScintilla): | |
def __init__(self, parent=None): |
This file contains hidden or 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
for f in layer.getFeatures(): | |
print f.geometry() | |
print f["YourFieldName"] |
This file contains hidden or 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
@command(alias="@") | |
def at(*args): | |
"Draw a line at distance and bearing | |
arg1 - bearing | |
arg2 - distance" | |
pass |
This file contains hidden or 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
commit e393191b58c2b5038462e1502d1b7097d8e5086c (HEAD, raster_alpha) | |
Author: Nathan Woodrow <[email protected]> | |
Date: Sat May 18 10:10:35 2013 +1000 | |
Raster alpha | |
diff --git a/python/core/raster/qgscolorrampshader.sip b/python/core/raster/qgscolorrampshader.sip | |
index 35404ab..c101db5 100644 | |
--- a/python/core/raster/qgscolorrampshader.sip | |
+++ b/python/core/raster/qgscolorrampshader.sip |
This file contains hidden or 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
layer = iface.activeLayer() | |
feature = layer.selectedFeatures()[0] | |
feature.geometry().boundingBox().toString() |
This file contains hidden or 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.utils import * | |
@qgsfunction(1, "Python", register=True) | |
def overlapslayer(values, feature, parent): | |
layername = values[0].toString() | |
lga = QgsMapLayerRegistry.instance().mapLayersByName(layername)[0] | |
lga = lga.getFeatures().next() | |
geom = feature.geometry() | |
if geom is None: return | |
return geom.within(lga.geometry()) |
This file contains hidden or 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
# 1.8 | |
layer.select() | |
for feature in layer: | |
# feature work | |
# 2.0 | |
for feature in layer.getFeatures(): | |
# feature work | |
# getFeatures returns a QgsFeatureIterator |
This file contains hidden or 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
@echo off | |
path %SYSTEMROOT%\system32;%SYSTEMROOT%;%SYSTEMROOT%\System32\Wbem;C:\CMake 2.8\bin;C:\GnuWin32\bin;C:\GnuWin32\bin;C:\OSGeo4W\bin;C:\Git\bin | |
set PYTHONPATH= | |
set VS90COMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\Common7\Tools\ | |
call "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 | |
set INCLUDE=%INCLUDE%;"C:\Program Files\Microsoft SDKs\Windows\v6.0A\include" | |
set LIB=%LIB%;"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib" |
This file contains hidden or 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 PyQt4.QtCore import QObject, pyqtSignal | |
class FeatureWrapper(QObject): | |
notifychanged = pyqtSignal(str, object) | |
def __init__(self, feature): | |
super(FeatureWrapper,self).__init__() | |
self.feature = feature | |
def __setitem__(self, key, value): |