Skip to content

Instantly share code, notes, and snippets.

View timlinux's full-sized avatar

Tim Sutton timlinux

View GitHub Profile
Native Windows:
lassort -i c:\Users\inasafe\Desktop\tandale1_densified_point_cloud.las -rescale 0.01 0.01 0.01 -olaz
lasground -i c:\Users\inasafe\Desktop\tandale1_densified_point_cloud_1.laz -city -ultra_fine -odix _g -olaz
# DTM
las2dem -i c:\Users\inasafe\Desktop\tandale1_densified_point_cloud_1_g.laz -keep_class 2 -thin_with_grid 0.125 -extra_pass -step 0.5 -ocut 2 -odix _dtm -obil
# DSM
las2dem -i c:\Users\inasafe\Desktop\tandale1_densified_point_cloud_1_g.laz -thin_with_grid 0.125 -extra_pass -step 0.5 -ocut 2 -odix _dsm -obil
timlinux@kartoza4:/home/realtime/inasafe-django/deployment> make staging-run
------------------------------------------------------------------
Building in staging mode
------------------------------------------------------------------
db uses an image, skipping
smtp uses an image, skipping
devdb uses an image, skipping
Building devuwsgi...
Step 0 : FROM kartoza/django-base
@timlinux
timlinux / gist:a57797a6650b10e1dd12
Created April 13, 2015 10:03
How to know the ide of the current impact function in InaSAFE
from PyQt4.QtGui import QDockWidget
app = iface.mainWindow()
dock = app.findChild(QDockWidget, 'DockBase')
dock.get_function_id()
'VolcanoPolygonPopulationFunction'
@timlinux
timlinux / pdf_generator.py
Last active March 20, 2022 20:11
Generate a QGIS map PDF using python
# coding=utf-8
# A simple demonstration of to generate a PDF using a QGIS project
# and a QGIS layout template.
#
# This code is public domain, use if for any purpose you see fit.
# Tim Sutton 2015
import sys
from qgis.core import (
@timlinux
timlinux / gist:952be093068311232e74
Created February 24, 2015 20:47
Setup pyspatialite on fedora
sudo python setup.py build_ext --include-dirs=/usr/include/
cd /tmp/pip_build_root/pyspatialite/
sudo python setup.py build_ext --include-dirs=/usr/include/
sudo pip install --no-download pyspatialite --include-dirs=/usr/include
gFunctionHelpTexts.insert( "if", QCoreApplication::translate( "function_help", "<h3>if() function</h3>\n"
"Returns the second argument if expression is true otherwise the third argument.\n"
"<br>\n"
"This function takes three arguments.\n"
"<h4>Syntax</h4>\n"
"<code>if(expression, result_if_true, result_if_false)</code><br>\n"
"\n"
"<h4>Arguments</h4>\n"
"<code>expression</code> - any valid expression or value, regardless of type.\n"
"<code>result_if_true</code> - any valid expression or value, regardless of type.\n"
@timlinux
timlinux / gist:ecb9210490959aa2000a
Last active August 29, 2015 14:15
QGIS-Certification-Meeting-12Feb2014
15∶24
timlinux Hi all
gioman joined
pcav joined
yjacolin joined
alexbruy joined
15∶50
timlinux he everyone
hi
we will wait 10 more minutes
@timlinux
timlinux / test_text.py
Created February 11, 2015 08:00
Example unit test for inasafe issue #1159
from encodings.utf_8 import encode
__author__ = 'timlinux'
import unittest
from safe.messaging.item.text import PlainText
class TestText(unittest.TestCase):
def test_plain_text(self):
@timlinux
timlinux / raster_to_xyz.py
Last active February 1, 2016 12:17
Simple example of how to convert a QGIS raster layer to an XYZ ascii file
from PyQt4.QtGui import QProgressBar
from PyQt4.QtCore import Qt
l = iface.activeLayer()
w = l.width()
h = l.height()
p = l.dataProvider()
# layers are base 1 for block reader
b = p.block(1, p.extent(), w, h)
f = file('/tmp/test.xyz', 'w')
f.write('Longitude,Latitude,VI')
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7b508ba in QwtSeriesStore<QPointF>::setData(QwtSeriesData<QPointF>*) () from /lib64/libqwt.so.6
Missing separate debuginfos, use: debuginfo-install CharLS-1.0-8.fc21.x86_64 GConf2-3.2.6-11.fc21.x86_64 ORBit2-2.14.19-13.fc21.x86_64 OpenEXR-libs-2.1.0-5.fc21.x86_64 PackageKit-gtk3-module-1.0.4-1.fc21.x86_64 PyQt4-4.11.3-1.fc21.x86_64 PyQwt-5.2.0-27.fc21.x86_64 adwaita-gtk2-theme-3.14.2.2-1.fc21.x86_64 alsa-lib-1.0.28-2.fc21.x86_64 armadillo-4.550.2-1.fc21.x86_64 arpack-3.1.3-4.fc21.x86_64 atk-2.14.0-1.fc21.x86_64 atlas-3.10.1-16.fc21.x86_64 avahi-glib-0.6.31-30.fc21.x86_64 avahi-libs-0.6.31-30.fc21.x86_64 blas-3.5.0-10.fc21.x86_64 bzip2-libs-1.0.6-14.fc21.x86_64 cairo-1.13.1-0.4.git337ab1f.fc21.x86_64 cfitsio-3.370-3.fc21.x86_64 clucene09-core-0.9.21b-13.fc21.x86_64 cyrus-sasl-lib-2.1.26-19.fc21.x86_64 dbus-glib-0.100.2-4.fc21.x86_64 dbus-libs-1.8.14-1.fc21.x86_64 elfutils-libelf-0.161-2.fc21.x86_64 elfutils-libs-0.161-2.fc21.x86_64 expat-2.1.0-10.