Skip to content

Instantly share code, notes, and snippets.

View timlinux's full-sized avatar

Tim Sutton timlinux

View GitHub Profile
```
nix-shell -p whitebox-tools
this derivation will be built:
/nix/store/84wi7lcplbf8ryldn8qxhk6jk0qfjwdg-whitebox_tools-2.2.0.drv
these 3 paths will be fetched (0.00 MiB download, 0.02 MiB unpacked):
/nix/store/dqckr5s73zsy3jcqqp774x9y6fzjl0rc-auditable-cargo-1.73.0
/nix/store/by2qyxr78hh3jhrrx8sikgavr3i9ap07-cargo-build-hook.sh
/nix/store/vrvkmmbkxwk2zf0b45jcfa9kc1wx8z31-cargo-check-hook.sh
copying path '/nix/store/dqckr5s73zsy3jcqqp774x9y6fzjl0rc-auditable-cargo-1.73.0' from 'https://cache.nixos.org'...
graph TD
    A[Father] -->|Parent| B[You]
    C[Mother] -->|Parent| B[You]
    B -->|Husband| D[Wife]
    B -->|Father| E[Daughter]
    D -->|Mother| E[Daughter]
@timlinux
timlinux / bright.json
Last active January 28, 2024 23:32
TileMaker OpenMapTiles Bright Style
{
"version": 8,
"name": "Empty Style",
"metadata": {"maputnik:renderer": "mbgljs"},
"sources": {
"planet": {"type": "vector", "url": "http://localhost:8000/services/planet"}
},
"sprite": "",
"glyphs": "https://orangemug.github.io/font-glyphs/glyphs/{fontstack}/{range}.pbf",
"layers": [
{
"version": 8,
"name": "testing",
"metadata": {"maputnik:renderer": "mbgljs"},
"sources": {
"MyCivitasStaging": {
"type": "vector",
"tiles": ["https://staging.mycivitas.ca/community-layer/{z}/{x}/{y}"],
"minZoom": 0,
"maxZoom": 14
@timlinux
timlinux / QGIS-ContributorLicenseAgreement.md
Created December 24, 2022 00:08
QGIS Hugo Website Contributor License Agreement

Agreement for QGIS.org Website Project

QGIS.org Individual Contributor License Agreement (“Agreement”) v1.0

This document is modelled on the OSGEO contributor license agreement V1.0

Thank you for your interest in contributing to a QGIS.org repository. In order to clarify the intellectual property license granted with Contributions from any person or entity, QGIS.org must have a Contributor License Agreement (“CLA”) on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of QGIS.org and its users; it does not change your rights to use your own Contributions for any other purpose. If you have not already done so, please complete and send an original signed Agreement to QGIS.org Association by email, [info@qgis.org] or by means of the automated GitHub helper we have installed. Please read this document carefully before s

H3 Playground

In this example I show how we can use the H3 API to do a simple workflow whereby we create a series of hex indexes along the boundary of a polygon and then calculate the distance of a point to all of the polygon boundary indices.

First we need to import h3 and pandas which will provide all the data structures and processing capabilities we need:

import h3
import pandas
@timlinux
timlinux / style.json
Last active September 30, 2022 14:58
Mapbox Vector Style for MapTiler Countries in QGIS
{
"version": 8,
"name": "Empty Style",
"metadata": {"maputnik:renderer": "mbgljs"},
"sources": {
"Tim": {
"type": "vector",
"tiles": ["http://localhost:9090/maps/world/{z}/{x}/{y}.pbf"],
"minZoom": 0,
"maxZoom": 14
@timlinux
timlinux / qgis-world.geojson
Last active June 18, 2022 00:50
QGIS Metabase Base Map - Do Not Delete
# Overview
This is a basemap for Metabase to be used on https://analytics.qgis.org.
It shows the QGIS project view of national borders of the world.
Based on world countries layer from Natural Earth.
Herewisth the provenance notes as stored in https://github.com/qgis/QGIS/tree/master/resources/data
# README World Map GeoPackage
The `world_map.gpkg` contains the following layers:
@timlinux
timlinux / sandbox.py
Created March 1, 2022 19:59
Debuggin parallel renderer
def render_image_to_file(self, name):
size = self.iface.mapCanvas().size()
image = QImage(size, QImage.Format_RGB32)
painter = QPainter(image)
settings = self.iface.mapCanvas().mapSettings()
self.iface.mapCanvas().refresh()
# You can fine tune the settings here for different
# dpi, extent, antialiasing...
# Just make sure the size of the target image matches
@timlinux
timlinux / KartozaContributorAgreement.md
Last active February 17, 2022 10:55
Kartoza Contributors Agreement

Agreement for Kartoza Open Source Projects

Based on Kartoza Individual Contributor License Agreement (“Agreement”) v1.0

This document is modelled on the OSGEO contributor license agreement V1.0

Thank you for your interest in contributing to a Kartoza repository. In order to clarify the intellectual property license granted with Contributions from any person or entity, Kartoza must have a Contributor License Agreement (“CLA”) on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of Kartoza and its users; it does not change your rights to use your own Contributions for any other purpose. If you have not already done so, please complete and send an original signed Agreement to The Open Source Geospatial Foundation, [address]. If necessary, you may send it by facsimile to Kartoza at [fax]. Please read this document carefully before signing and keep a copy for your records.

You accept