Skip to content

Instantly share code, notes, and snippets.


Henry Walshaw om-henners

View GitHub Profile
om-henners / Calculate your 5km travel bubble.ipynb
Created Sep 6, 2020
Quick bit of Python code to calculate a 5km travel buffer given as a talk at PyConlineAU 2020!
View Calculate your 5km travel bubble.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
om-henners / Area of Australian fires vs countries.ipynb
Created Jan 3, 2020
Compare the area burnt by Australia's fires to the area of countries and plot out a quick comparison
View Area of Australian fires vs countries.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
om-henners / filter.jq
Last active Oct 7, 2019
jq filter to transform GeoJSON Geometry Collection into Feature Collection
View filter.jq
.properties as $propertiess | {
"type": "FeatureCollection",
"features": [
(.geometries[] |
"type": "Feature",
"properties": (.properties + $propertiess),
"geometry": del(.properties)
om-henners /
Created Jul 3, 2019
Simple flask app to dummy up a Podcast RSS feed using Flask and feedgen. Written with Python 3.7
Simple app that generates a podcasst XML feed for Radicalized
To be fair this could be easily adapted to any audiobook / set of NP3s - you'd
just need to change the image, the path to the music and all the descriptions.
- feedgen
- flask
om-henners /
Created Apr 28, 2019
Generate KML files for the first three levels of resolution using Uber Eng's h3 (
mkdir -p KML
for resolution in $(seq 1 3); do
h3ToHier ${resolution} | h3ToGeoBoundary 1 res${resolution}cells.kml "Res ${resolution} Cells" > KML/res${resolution}cells.kml
h3ToHier ${resolution} | h3ToGeo 1 res${resolution}centers.kml "Res ${resolution} Centers" > KML/res${resolution}centers.kml
om-henners /
Created Nov 19, 2018
Marshmallow serializers for turning fields into GeoJSON objects based on flask-sqlalchemy and geoalchemy2
Marshmallow wrappers to produce GeoJSON instead of a flat dictionary.
from flask_marshmallow import Marshmallow
import geoalchemy2
from geoalchemy2.shape import from_shape, to_shape
from marshmallow import fields, pre_load, post_dump, ValidationError
import marshmallow_sqlalchemy as msqla
from shapely import geometry
om-henners / poster_text.inx
Last active Feb 14, 2017
Inkscape extension to dump source code text on a page, Lorem Ipsum style. Inspired by To install, drop these to files in your ~/.config/inkscape/extensions folder, restart inkscape and it's in the Extensions > Text menu.
View poster_text.inx
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="">
<_name>Source Code Text</_name>
<dependency type="executable" location="extensions"></dependency>
<dependency type="executable" location="extensions"></dependency>
<param name="tab" type="notebook">
<page name="Options" _gui-text="Options">
<param name="directory" type="string" _gui-text="Directory to search for code:">~/</param>
<param name="pattern" type="string" _gui-text="Filename pattern to match:">py</param>
om-henners /
Last active Aug 15, 2016
Download pyconau tweets with Twython. Because of twitter's rate limiting this will take a while to execute. Also, the files wind up pretty large (~300mb per rate limited block)
# coding: utf-8
from __future__ import print_function
from datetime import date, timedelta, datetime
import json
from time import sleep
from twython import Twython, TwythonRateLimitError
om-henners /
Created Aug 11, 2016
Quick sample of converting an ArcGIS feature class to a pandas dataframe using arcpy.
import arcpy
import pandas as pd
def build_df_from_arcpy(table, index_col=None):
Build a pandas dataframe from an ArcGIS Feature Class.
Uses the arcpy Search Cursor to loop over a feature class in pandas and
generate a pandas dataframe. If the dataset is a feature class with a
View river_outflow.csv
station date mm
Footscray 8/3/15 0.20
Footscray 15/3/15 0.00
Footscray 22/3/15 1.60
Footscray 29/3/15 0.80
Footscray 5/4/15 0.00
Footscray 12/4/15 5.20
Footscray 19/4/15 8.00
Footscray 26/4/15 8.00
Footscray 3/5/15 0.60
You can’t perform that action at this time.