Skip to content

Instantly share code, notes, and snippets.

{
"metadata": {
"name": "",
"signature": "sha256:682c5519bdf342660804b052a5fae80460925acb64a8eed37c1e2caf8ac791c1"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mlaloux
mlaloux / line_from_pt_dist1.py
Created March 7, 2013 16:58
Création d'une ligne à partir d'une direction (en degrés) et d'une distance dans QGIS - Creating a line from a direction (in degrees) and a distance in QGIS (QGIS 2.8I)
'''For QGIS 2.8
Martin Laloux, 2012'''
from PyQt4.QtCore import *
from numpy import *
class distance(object):
def __init__(self,a,angle,distance):
self.a = a.asPoint()
self.xori = self.a[0]
@mlaloux
mlaloux / tree.md
Created March 7, 2013 17:00 — forked from hrldcpr/tree.md

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@mlaloux
mlaloux / line_from_pt_dist2.py
Created March 7, 2013 16:58
Création d'une ligne à partir d'une direction (en degrés) et d'une distance dans QGIS - Creating a line from a direction (in degrees) and a distance in QGIS (QGIS master with the new Python API)
'''QGIS master with the new Python API
Martin Laloux 2013'''
from PyQt4.QtCore import *
from numpy import *
from PyQt4.QtCore import *
from numpy import *
a = QgsGeometry.fromPoint(QgsPoint(122.989235,13679.083853))