This file contains 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 counter(start, interval): | |
count = start | |
while True: | |
yield count | |
count += interval | |
count = counter(start=1, interval=1) | |
def autoIncrement(): | |
return str(count.next()).zfill(3) |
This file contains 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
CALL "C:\Program Files\QGIS 3.4\bin\o4w_env.bat" | |
CALL "C:\Program Files\QGIS 3.4\bin\py3_env.bat" | |
CALL "C:\Program Files\QGIS 3.4\bin\qt5_env.bat" | |
SET PYTHONPATH=C:\Program Files\QGIS 3.4\apps\qgis-ltr\python | |
cmd |
This file contains 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.core import * | |
from qgis.gui import * | |
from PyQt4.QtCore import * | |
from PyQt4.QtGui import QApplication | |
from PyQt4.QtXml import * | |
import sys | |
import xml.etree.ElementTree as ET | |
app = QgsApplication([], True) |
This file contains 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 os, arcpy | |
#create blank text file | |
with open("C:\\Temp\\GISlayers.txt", "w") as txt: | |
for root, dirs, files in os.walk("C:\\Temp\\temp"): | |
for f in files: | |
#look for shapefiles | |
if f.endswith('.shp') or f.endswith('.lyr') or | |
f.endswith('.img'): | |
desc = arcpy.Describe(root + "\\" + f) |
This file contains 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
SET OSGEO4W_ROOT=C:\Program Files\QGIS 3.2 | |
SET QGISNAME=qgis | |
SET QGIS=%OSGEO4W_ROOT%\apps\%QGISNAME% | |
set QGIS_PREFIX_PATH=%QGIS% | |
CALL "%OSGEO4W_ROOT%\bin\qt5_env.bat" | |
CALL "%OSGEO4W_ROOT%\bin\py3_env.bat" | |
set PATH=%OSGEO4W_ROOT%\bin;%QGIS%\bin;C:\Program Files (x86)\Git\bin;%PATH%; | |
set PYTHONPATH=%PYTHONPATH%;%QGIS%\python |
This file contains 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
SET ROOT=C:\Program Files\QGIS 3.0 | |
CALL "%ROOT%\bin\o4w_env.bat" | |
CALL "%ROOT%\bin\py3_env.bat" | |
CALL "%ROOT%\bin\qt5_env.bat" | |
SET PYTHONPATH=%PYTHONPATH%;%ROOT%\apps\qgis\python | |
SET PYCHARM="C:\Program Files\JetBrains\PyCharm Community Edition 2017.2.2\bin\pycharm64.exe" | |
start "PyCharm aware of QGIS" /B %PYCHARM% %* |
This file contains 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 requests | |
import base64 | |
@qgsfunction(args='auto', group='Custom') | |
def show_camera(feed, feature, parent): | |
svg = """ | |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<svg> | |
<g> | |
<image xlink:href="data:image/jpeg;base64,{0}" height="256" width="320" /> |
This file contains 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
string user = @"MULTIPOLYGON ( | |
((497140.111504213 7000067.0051564, 497140.111504239 7000067.00515642, | |
497108.282321511 6999764.50865007, 496870.11273669 6999736.95241933, | |
496870.112736702 6999736.95241954, 496870.11273669 6999736.95241954, | |
496874.346768004 6999813.10375028, 497140.111504239 7000067.00515664, | |
497140.111504213 7000067.0051564)), | |
((497171.990745506 7000155.85678491, | |
497171.990745576 7000155.85678476, 496850.952737626 6999819.44373352, | |
496816.906830532 6999899.81645738, 496816.9068306 6999899.81645744, | |
496816.906830532 6999899.8164576, 497150.71415798 7000200.27434632, |
This file contains 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 walk(node): | |
if node.nodeType() == QgsExpression.ntBinaryOperator: | |
handle_binary(node) | |
elif node.nodeType() == QgsExpression.ntUnaryOperator: | |
print("Unary") | |
elif node.nodeType() == QgsExpression.ntInOperator: | |
print("In") | |
elif node.nodeType() == QgsExpression.ntFunction: | |
handle_function(node) | |
elif node.nodeType() == QgsExpression.ntLiteral: |
This file contains 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
ogr2ogr -f "MSSQLSpatial" "MSSQL:DRIVER={SQL Server Native Client 11.0};SERVER=CC-CST-SQL3;DATABASE=GISPROD;TABLE=tech.trees;trusted_authentication=true;" "D:\Temp\Trees.sqlite" -SQL "SELECT * FROM Trees" |
NewerOlder