Skip to content

Instantly share code, notes, and snippets.

View kgjenkins's full-sized avatar

Keith Jenkins kgjenkins

View GitHub Profile
@kgjenkins
kgjenkins / index.md
Last active October 27, 2021 18:44
Working with GFED data in QGIS

Working with GFED data in QGIS

GFED (Global Fire Emissions Database) data is distributed in HDF5 format, which is commonly used for multidimensional datasets, but can sometimes be a challenge to use in QGIS for a variety of reasons. First, it doesn't have an explicitly-defined CRS that QGIS can simply use to display the data in the correct location. Second, there are many different subdatasets packed into a single GFED .hdf5 file, representing different variables, units, and time periods.

@kgjenkins
kgjenkins / index.md
Last active December 11, 2020 21:28
Madagascar goes for a swim

This was created in QGIS... details coming soon! madagascar-swim

@kgjenkins
kgjenkins / index.html
Last active December 5, 2020 20:16
Explosion followed by glitch art
<html>
<head>
</head>
<body>
<canvas id='canvas' width=960 height=500></canvas>
<script>
var c = canvas.getContext('2d');
@kgjenkins
kgjenkins / README.md
Last active November 30, 2022 09:38
QGIS Python to automatically update layer from data source

The following Python code will, every 30 seconds, automatically update the data from the source for any QGIS layer with 'autoUpdate' in the layer name. Each time it updates, it will put the timestamp in the layer name, although you could leave that part out.

This is particularly useful for remote data sources like json-over-http or even local CSV files that might be changed by another program while the QGIS project is open.

Just paste the code into the QGIS Python console.

import threading
import datetime
@kgjenkins
kgjenkins / README.md
Last active September 11, 2020 14:12
ARCH 5115 - QGIS Workshop, Day 2

ARCH 5115 - QGIS Workshop, Day 2

The QGIS workshop folder on Box has been updated, so please download the entire "QGIS-workshops" folder to your computer.

  • Unzip the files
  • Double-click the workshop2.qgz project to open it in QGIS (or else open it from within QGIS)

Elevation raster data

@kgjenkins
kgjenkins / README.md
Last active September 11, 2020 13:35
ARCH 5115 - QGIS Workshop, Day 1
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Demo</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"
GEOID10 GEOID10_2
0102200 0102200
0101700 0102200
0102300 0102200
0102600 0102200
0102703 0102200
0102100 0102200
1203301 0102200
1211300 0102200
1209100 0102200
@kgjenkins
kgjenkins / README.md
Last active February 20, 2020 21:06
Paint splotch icons in QGIS

Paint splatter icons in QGIS

QGIS has the ability to style points using SVG symbols, and size and color them by attributes of the points.

SVG is a file format that means Scalable Vector Graphics. Because they are a vector format, they can easily be sized without losing detail or becoming pixelated (as can happen with raster icons).

Free or public domain SVG files can be found on the web. For example, here is a collection of paint splatters: https://svgsilh.com/tag/splatter-1.html

SVG files are actually text files that can be viewed in any text editor. Many SVGs are solid black; if you want to be able to color them in QGIS you'll want to edit the SVG and change fill="#000000" to fill="param(fill)" -- this has already been done for splatter1.svg -- click the "raw" button below to see the SVG code.

@kgjenkins
kgjenkins / README.md
Last active February 20, 2020 17:30
Splitting MS Buildings into county-based files

Splitting Microsoft Buildings into county-based files

Microsoft US Building Footprints are available at:
https://github.com/Microsoft/USBuildingFootprints

The state-based downloads are in .geojson format, which is a pretty bad choice for datasets this large. Bad because .geojson has no spatial index, making it very slow to load and render. So it will be useful to split and save them into a separate file (geopackage or shapefile) for each county. Also, some of the polygons have invalid geometries that we should fix along the way.