Skip to content

Instantly share code, notes, and snippets.

View andrewharvey's full-sized avatar

Andrew Harvey andrewharvey

View GitHub Profile
@ashquarky
ashquarky / tfnsw-to-osm-osmosis.xml
Last active February 25, 2020 10:35
Osmosis TagTransform file to convert TfNSW Cycleways data into OSM-ready tags
<?xml version="1.0"?>
<!--
Things to note:
- You may or may not want name= and alt_name= from this dataset, as name= has other sources
and standards (St. vs Street); while alt_name seems to be naming sidewalks after the
assosciated road
- name= and alt_name= are *stripped by default*. Scroll down and uncomment the appropriate
lines to output them.
- foot=designated on highway=cycleway is not accompanied by bicycle=designated by default
- SURFACE=Spray Seal and SURFACE=AC are translated as surface=asphalt
#!/bin/bash
# rename TMS tiles to the XYZ schema
# no quoting, since all files have simple numeric names
# do not run this anywhere else than INSIDE your tiles directory
# run it like this: find . -name "*.png" -exec ./tms2xyz.sh {} \;
filename=$1
tmp=${filename#*/} # remove to first /
@hamishcampbell
hamishcampbell / polyomino.py
Created September 6, 2013 23:26
Polyomino Reference Source - PyCon 2013
# -*- coding: utf-8 -*-
#!/usr/bin/env python
import sys
class Polyomino(object):
def __init__(self, iterable):
self.squares = tuple(sorted(iterable))
def __repr__(self):