Skip to content

Instantly share code, notes, and snippets.

View timlinux's full-sized avatar

Tim Sutton timlinux

View GitHub Profile
@timlinux
timlinux / docker-compose.yml
Created June 12, 2018 06:17
Example docker compose for QGIS
version: "3"
services:
qgisserver:
image: kartoza/qgis-server:LTR
hostname: qgis-server
environment:
- QGIS_PROJECT_FILE=/project/Swellendam.qgs
volumes:
@timlinux
timlinux / docker-node-setup.sh
Last active April 12, 2018 11:23
docker-node-setup
#!/bin/bash
# Setup script for new cloud nodes
# Will require key based authentication for SSH
# Will enabled automatic package updates
echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
/etc/init.d/ssh restart
apt install -y byobu links2 vim python-pip htop figlet
apt install -y chkrootkit sshguard logwatch
@timlinux
timlinux / json-pg-query.sql
Last active January 9, 2018 12:27
TrailMapperTrails
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
update trail set guid = uuid_generate_v4();
ALTER TABLE public.trail
ADD COLUMN geom geometry;
SELECT json_build_object(
'id', id,
'name', name,
'notes', notes,
@timlinux
timlinux / gist:68b3ca669acff683f28f73af4e32d46e
Created November 20, 2017 07:38
Setup QGIS 2.18 on Ubuntu 16.03
#!/bin/bash
echo "deb http://qgis.org/debian xenial main" >> /etc/apt/sources.list
echo "deb-src http://qgis.org/debian xenial main" >> /etc/apt/sources.list
wget -O - http://qgis.org/downloads/qgis-2017.gpg.key | gpg --import
wget -O - http://qgis.org/downloads/qgis-2017.gpg.key | apt-key add -
apt update
apt-get install qgis python-qgis qgis-plugin-grass
@timlinux
timlinux / gist:f4fffb8ba5513a49b9134519d6f3e592
Created March 17, 2017 15:07
QGIS Crash on vertex edit: 9887734a1fd413a3c3a05c6dfaafa58baeb1e0ef
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 org.qt-project.QtGui 0x000000010e7d1862 QAccessibleEvent::uniqueId() const + 82
1 libqcocoa.dylib 0x000000011eaefd13 0x11eab8000 + 228627
2 org.qt-project.QtWidgets 0x000000010e4b0492 QListView::selectionChanged(QItemSelection const&, QItemSelection const&) + 338
3 org.qt-project.QtCore 0x0000000110279539 QMetaObject::activate(QObject*, int, int, void**) + 3113
4 org.qt-project.QtCore 0x00000001102054aa QItemSelectionModel::emitSelectionChanged(QItemSelection const&, QItemSelection const&) + 314
5 org.qt-project.QtCore 0x0000000110205305 QItemSelectionModel::select(QItemSelection const&, QFlags<QItemSelectionModel::SelectionFlag>) + 709
6 org.qt-project.QtCore 0x000000011020500b QItemSelectionModel::select(QModelIndex const&, QFlags<QItemSelectionModel::SelectionFlag>) + 59
7 org.qt-project.QtCore 0x0000000110205c78 QItemSelectionModel::setCurrentIndex(QModelIn
@timlinux
timlinux / readme.md
Last active November 20, 2024 11:34
A simple attempt to make a spinning globe in QGIS by continuously manipulating the CRS.

QGIS Globe Spinner

A simple attempt to make a spinning globe in QGIS by continuously manipulating the CRS. Just load a world boundaries layer and run this in the QGIS console. Definitely very prototype stuff here so be warned...

temporary

@timlinux
timlinux / error
Created July 2, 2016 15:13
install prefix
-- Installing: /usr/lib64/python2.7/site-packages/qgis/_core.so
CMake Error at python/cmake_install.cmake:50 (file):
file INSTALL cannot copy file
"/home/timlinux/dev/cpp/QGIS/build/output/python/qgis/_core.so" to
"/usr/lib64/python2.7/site-packages/qgis/_core.so".
Call Stack (most recent call first):
cmake_install.cmake:61 (include)
Makefile:93: recipe for target 'install' failed
======================================================================
ERROR: test_layer_legend_index (safe.gui.widgets.test.test_dock.TestDock)
Test we can get the legend index for a layer.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 345, in test_layer_legend_index
index = self.dock.layer_legend_index(layer)
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/dock.py", line 1334, in layer_legend_index
layer_id = layer.id()
AttributeError: 'NoneType' object has no attribute 'id'
@timlinux
timlinux / gist:4b9c73546c1757b15b44ec349d228cb1
Created June 20, 2016 12:53
Failing tests on QGIS 2.8.1 with
======================================================================
ERROR: Test generate_html_reports function.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/timlinux/inasafe/safe/gui/tools/test/test_impact_merge_dialog.py", line 514, in test_generate_html_reports
first_report_dict, second_report_dict)
File "/home/timlinux/inasafe/safe/gui/tools/impact_merge_dialog.py", line 843, in generate_html_reports
html_to_file(html, path)
File "/home/timlinux/inasafe/safe/utilities/utilities.py", line 319, in html_to_file
with codecs.open(file_path, 'w', encoding='utf-8') as f:
@timlinux
timlinux / inasafe-3.2-if-changes.md
Created September 9, 2015 11:25
inasafe-3.2-if-changes.md
Changed New Old
N earthquake/earthquake_building earthquake/earthquake_building
N earthquake/itb_earthquake_fatality_model earthquake/itb_earthquake_fatality_model
N earthquake/pager_earthquake_fatality_model earthquake/pager_earthquake_fatality_model
N generic/classified_raster_population generic/classified_raster_population
N generic/classified_polygon_population generic/classified_polygon_population
N generic/continuous_hazard_population generic/continuous_hazard_population
N generic/classified_polygon_building generic/classified_polygon_building
N generic/classified_raster_building generic/classified_raster_building