Skip to content

Instantly share code, notes, and snippets.

View timlinux's full-sized avatar

Tim Sutton timlinux

View GitHub Profile
@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

@timlinux
timlinux / FedoraWorkstationSetupNotes.md
Last active June 13, 2023 11:44
Fedora Workstation Setup Notes

Fedora Workstation Installation Notes

These are my notes for setting up my production workstation with QGIS dev environment and various other niceties.

Mounting encrypted drives

I have three 2TB SSD drives in addition to the system drive which is 250GB.

To get them to mount you need to not include them in the original setup of the computer disk scheme. Then after first log in to the system do the following:

@timlinux
timlinux / BuildingPCRasterOnFedora.md
Last active April 5, 2022 06:28
Building PCRaster on Fedora

What follows are the steps I took to build PCRaster on Fedora (34) from source. I chose to build from source because I didn't want to use the conda installer and I could not find a stand alone package.

The process below assumes that you have a working QGIS build environment since some of the PCRaster dependencies are provided by the QGIS dependency tree too.

git clone git@github.com:pcraster/pcraster.git