Skip to content

Instantly share code, notes, and snippets.

veltman /
Last active April 19, 2023 16:32
Generating an SVG from a set of shapefiles

Generating an SVG from a set of shapefiles

The USGS provides detailed downloads of fire perimeters, with timestamped files that can be used to show the spread of a major fire over time.

Using the 2017 Thomas fire as an example, we'll process this data into a single SVG file with all the different perimeter measurements.

This index page contains links to a series of shapefiles of the fire boundary, each one with a timestamp:

veltman /
Last active September 27, 2019 22:12
Making a big image zoomable

Making a big image zoomable

When you have a giant image and you want to make it easy to pan and zoom without downloading the whole 50MB image into someone's browser, a nice workaround is to cut that image into tiles at different zoom levels and view it as it were a map. An example where I've used this technique is The "Snowpiercer" Scenario.

One way to cut your big image into the requisite tiles is with

Alternatively, this Node script will do the cutting after you install node-canvas and mkdirp:

const fs = require("fs"),
tomshanley / .block
Last active September 13, 2019 11:08
Recreating the NY Times immigration flows chart
license: mit
height: 1500
border: no
scrolling: no
# python3 version, derived from python2 version
# taken from
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python3
# then in your browser, visit:
# https://localhost:4443
eteq / parallax_GaiaDR2.ipynb
Last active June 15, 2021 00:37
An demonstration of parallax using stars near the sun from the Gaia mission, astropy, astroquery, and matplotlib.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Andrew-Reid / index.html
Last active June 29, 2018 11:41
Voronoi - voronoi.findAll()
<script src=""></script>
<script src="voronoi.js"></script>
var width = 960;
var height = 500;
var data = d3.range(200).map(function(d) {
var y = d3.randomNormal(height / 2,80)();
#ifdef GL_ES
precision mediump float;
precision mediump int;
varying vec4 vertColor;
varying vec3 vertNormal;
varying vec3 vertLightDir;
varying vec4 vertTexCoord;
rveciana / .block
Last active September 13, 2019 10:25
Coastal Vignette with D3js
licence: mit
akngs / .block
Last active May 5, 2020 17:45
D3 implementation of an agent-based predator-prey model.
license: gpl-3.0