Skip to content

Instantly share code, notes, and snippets.

View kr-stn's full-sized avatar

Kersten kr-stn

View GitHub Profile
@kr-stn
kr-stn / random-QML.py
Created October 25, 2016 13:57
Generate 5000 randomly colored QML styles for display of segmentation results.
import random
for value in range(5000):
print("<item alpha=\"255\" value=\"{}\" label=\"{}\" color=\"#{}\"/>".format(value, value, hex(random.randint(0, 16777215))[2:].upper()))
#!/usr/bin/env python
__author__ = 'kersten.clauss'
__date__ = '28.03.2015'
"""script to create a vector/polygon from Hansens 30m global tree cover dataset
(http://earthenginepartners.appspot.com/science-2013-global-forest/download_v1.1.html)
Each tile will be downloaded, filtered to >75% tree cover for 2013 and merged into a global vector datset. The format of
the vector dataset is SpatiaLite/SQLite. It is advised to use the resampling to 250m option otherwise the resulting
@kr-stn
kr-stn / GTiff_compression_benchmark.py
Last active July 20, 2023 13:02
Benchmark filesize and read/ write times for various GeoTiff compression algorithms
__author__ = 'kersten.clauss'
"""Benchmark different GeoTiff compression algorithms.
Usage: GTiff_compression_benchmark.py some_geo.tif
Requires the GDAL tools to be present and executable from the command line of your system.
This script will take a GeoTiff as input and create copies with different compression algorithms from it.
It measures the filesize, compression and decompression times and returns them as a table.