Skip to content

Instantly share code, notes, and snippets.

View andrewharvey's full-sized avatar

Andrew Harvey andrewharvey

View GitHub Profile
@andrewharvey
andrewharvey / expire-tilecache-disk.pl
Created August 25, 2011 12:13
Expires a TileCache Disk cache given an expired tiles list from osm2pgsql
#!/usr/bin/perl -w
# This script was written to expire tiles from a TileCache Disk Cache by
# deleting them given a list of tiles to expire as generated by osm2pgsql.
#
# Author: Andrew Harvey <andrew.harvey4@gmail.com>
# License: CC0 http://creativecommons.org/publicdomain/zero/1.0/
#
# To the extent possible under law, the person who associated CC0
# with this work has waived all copyright and related or neighboring
@andrewharvey
andrewharvey / 3d-nearmap.html
Created September 4, 2011 11:18
A web map based on Polymaps delivering a 3D experience for viewing NearMap aerial imagery
<!--
This page licensed CC0 http://creativecommons.org/publicdomain/zero/1.0/
Some of the javascript code based of examples at http://polymaps.org/ex/
This is just a prototype/technology test. It probably isn't the cleanest solution...
TODO:
* Ctrl + click and drag should rotate the map just like the keys do
* add perspective option
-->
@andrewharvey
andrewharvey / configure.py
Created September 14, 2011 11:02
Carto stylesheet; Cycle focused overlay based on OSM data
#!/usr/bin/env python
# Copyright (c) 2011, Development Seed, Inc.
# 2011, Andrew Harvey <andrew.harvey4@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
@andrewharvey
andrewharvey / generate-map-previews.sh
Created December 20, 2011 10:25
HTML pages for my dev/demo site.
#!/bin/sh
# dimensions of the preview images
WIDTH=400
HEIGHT=200
# the spot we use for the OSMT preview
OSMT_X=151.12508
OSMT_Y=-34.04459
OSMT_Z=16
@andrewharvey
andrewharvey / make-osm-coastline-extract.sh
Created December 24, 2011 09:13
Reduce the size of OSM coastline SHAPE files given a bounding box.
#!/bin/sh
# This script uses ogr2ogr to filter a SHAPE file to within a given bounding
# box, where the SHAPE file is in the Google Maps projection and the bounding
# box is given in WGS84.
# Specifically designed for reducing the size of OpenStreetMap shoreline_300
# and processed_p files.
CITY="NSW"
@andrewharvey
andrewharvey / README.md
Created January 8, 2012 00:07
Incrementally patch a base .osm file with several .osc files.

#About These scripts are designed to consume an existing OSM minute-replicate (as produced by Osmosis) on the local file system and apply these diffs to an existing .osm extract, thereby patching your .osm file with the changes present in the minute-replicate. These scripts are simply wrappers around Osmosis.

These scripts don't apply each one minute .osc.gz file individually to the .osm extract, rather they group together a bunch of one minute files together and applies that bunch at once to your .osm extract.

@andrewharvey
andrewharvey / natmap-index2osm.pl
Created January 19, 2012 09:14
This script converts the mapdata.txt index file given on the AUSLIG NATMAP digital national 1:250000 topographic map series, into a .osm format.
#!/usr/bin/perl -w
# Info: This script converts the mapdata.txt index file given on the AUSLIG
# NATMAP digital national 1:250000 topographic map series, into a .osm
# format.
# Author: Andrew Harvey (http://andrewharvey4.wordpress.com/)
#
# To the extent possible under law, the person who associated CC0
# with this work has waived all copyright and related or neighboring
# rights to this work.
@andrewharvey
andrewharvey / Makefile
Created January 22, 2012 01:32
Pulls data from http://data.gov.au/dataset/diisr-locations/ and converts to OSM format.
# Author: Andrew Harvey (http://andrewharvey4.wordpress.com/)
#
# To the extent possible under law, the person who associated CC0
# with this work has waived all copyright and related or neighboring
# rights to this work.
# http://creativecommons.org/publicdomain/zero/1.0/
FILE="DIISR_Locations_Nov2011"
all : clean download convert
@andrewharvey
andrewharvey / nearmap-to-josm-imagery.pl
Created January 28, 2012 02:27
CGI program which generates a JOSM imagery XML file for NearMap PhotoMaps for a given location.
#!/usr/bin/perl -wT
# This CGI application given a lat and lon, will query nearmap.com for available
# PhotoMaps at that location and return them as a JOSM standard map source xml
# document in the schema as defined at http://josm.openstreetmap.de/maps-1.0
#
# This script is licensed CC0 by Andrew Harvey <andrew.harvey4@gmail.com>
#
# To the extent possible under law, the person who associated CC0
# with this work has waived all copyright and related or neighboring
@andrewharvey
andrewharvey / Gazetteer2010_txt.vrt
Last active September 30, 2015 22:57
Convert Geoscience Australia Gazetteer 2010 into the OSM XML format
<OGRVRTDataSource>
<OGRVRTLayer name="Gazetteer2010_txt">
<SrcDataSource>Gazetteer2010_txt.txt</SrcDataSource>
<GeometryType>wkbPoint</GeometryType>
<LayerSRS>GDA94</LayerSRS>
<GeometryField encoding="PointFromColumns" x="LONGITUDE" y="LATITUDE"/>
</OGRVRTLayer>
</OGRVRTDataSource>