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
<h3>coalesce() function</h3>
Returns the first non-NULL value from the expression list.
<br>
This function can take any number of arguments.
<h4>Syntax</h4>
<code>coalesce(expression1, expression2 ...)</code><br>
<h4>Arguments</h4>
<code>expression</code> - any valid expression or value, irregardless of type.
<br>
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)
# Get the latest changes
git fetch upstream
# While on master
# Bring my master up to line with latest stuff
git rebase upstream/master
# Checkout the branch for working
git checkout -b working
---
layout: post
title: "My QGIS git workflow"
description: ""
category: git
tags: [git qgis]
---
{% include JB/setup %}
{% excerpt %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My QGIS git workflow</title>
<meta name="description" content="">
<meta name="author" content="Nathan Woodrow">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My QGIS git workflow</title>
<meta name="description" content="">
<meta name="author" content="Nathan Woodrow">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My QGIS git workflow</title>
<meta name="description" content="">
<meta name="author" content="Nathan Woodrow">
class qchainageDialog(Ui_Dialog):
def __init__(self):
Ui_Dialog.__init__(self)
# Set up the user interface from Designer.
# self.iface = parent
self.setupUi(self)
self.distanceSpinBox.setValue(1)
self.qgisSettings = QSettings()
mylayer = qgis.utils.iface.activeLayer()
mylayer.select()
for feature in mylayer:
geom = feature.geometry()
attrs = feature.attributeMap()
/**
* This class caches features of a given QgsVectorLayer.
* The features are automatically updated and/or invalidated, whenever a change happens to the feature.
*
* It is the callers responsibility to make sure, that he specifies all required fields in every select operation.
* There is no guarantee, that a cached feature will contain a field not specified in a previous select operation.
*
* Performance:
* Depending on the usage scenario, it can be a good idea to prepopulate the cache by calling select, nextFeature and
* and removeCachedFeature. This is especially interesting, whenever requesting a single feature from the dataProvider