Skip to content

Instantly share code, notes, and snippets.

View andrewharvey's full-sized avatar

Andrew Harvey andrewharvey

View GitHub Profile
@andrewharvey
andrewharvey / shape_merge
Created December 17, 2015 06:06
Merge many Shape files together using ogr2ogr
#!/bin/bash
dest_dir="output"
dest_layer="shape_file"
mkdir -p "${dest_dir}"
i=0
for src_file in source/*.shp ; do
echo "Reading ${src_file}"
@andrewharvey
andrewharvey / josm_lpi_web_services.xml
Last active December 8, 2015 23:42
JOSM Imagery Source Definition for NSW LPI Web Services
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This file describes maps provided by NSW LPI at http://www.lpi.nsw.gov.au/mapping_and_imagery/lpi_web_services
This file has been released under CC0 https://creativecommons.org/publicdomain/zero/1.0/
Bounding shapes are derived from the respective data © Land and Property Information 2015
-->
<imagery xmlns="http://josm.openstreetmap.de/maps-1.0">
<entry>
<name>LPI NSW Base Map</name>
@andrewharvey
andrewharvey / GTFS-to-GEOJSON.md
Last active November 10, 2015 01:28 — forked from bertspaan/GTFS-to-GEOJSON.md
Ruby script to convert GTFS stops and shapes to GeoJSON.

Ruby script to convert stops.txt and shapes.txt to GeoJSON.

@andrewharvey
andrewharvey / Makefile
Created September 24, 2015 10:39
Scrips to mass download and extract animal tracks uploaded to zoatrack.org
# Scrips to mass download and extract animal tracks uploaded to zoatrack.org
#
# Originally by Andrew Harvey <andrew.harvey4@gmail.com>
# This file is licenced CC0 http://creativecommons.org/publicdomain/zero/1.0/
#
# At the time of writing, all data provided from zoatrack is released under the
# Creative Commons Attribution-NonCommercial-NoDerivs License.
# http://zoatrack.org/
get:
@andrewharvey
andrewharvey / asus_kb_backlight.sh
Last active January 1, 2016 07:19
Shell script to modify the ASUS Keyboard LED backlight Brightness
#!/bin/bash
# Shell script to modify the ASUS Keyboard LED backlight Brightness
# Must be run as root
# 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
# rights to this work.
@andrewharvey
andrewharvey / inplace-mbtiles2osmand.sh
Last active January 13, 2023 16:39
In-place conversion of an mbtiles SQLite3 database into an osmand offline tiles SQLite3 database.
#!/bin/sh
# 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/
SCRIPT_DIR=`dirname $0`
if [ -e $1 ] ; then
@andrewharvey
andrewharvey / get_address.sh
Created November 30, 2012 22:59
NSW Food Authority Register of Penalty Notices Scraper
#!/bin/sh
xpath-values.pl "/penalty_notices/notice/address" < penalty_notices.pp.xml
<OGRVRTDataSource>
<OGRVRTLayer name="AGRI_GCP.gdb">
<SrcDataSource>AGRI_GCP.gdb.csv</SrcDataSource>
<FID>GcpID</FID>
<GeometryType>wkbPoint25D</GeometryType>
<LayerSRS>GEOGCS["GDA94",DATUM["Geocentric Datum of Australia 1994",SPHEROID["GRS 1980",6378137.0,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0.0,0.0,0.0,0.0,0.0,0.0,0.0],AUTHORITY["EPSG","6283"]],PRIMEM["Greenwich",0.0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.017453292519943295],AXIS["Geodetic latitude",NORTH],AXIS["Geodetic longitude",EAST],AXIS["Ellipsoidal height",UP],AUTHORITY["EPSG","4939"]]</LayerSRS>
<GeometryField encoding="PointFromColumns" x="GPS_Long" y="GPS_Lat" z="GPS_Ht" reportSrcColumn="FALSE"/>
</OGRVRTLayer>
</OGRVRTDataSource>
@andrewharvey
andrewharvey / wordpress-export2chronicle.pl
Created November 3, 2012 08:30
WordPress eXtended RSS file to Chronicle converter
#!/usr/bin/perl -w
=head1 NAME
wordpress-export2chronicle - WordPress eXtended RSS file to Chronicle converter.
=cut
=head1 SYNOPSIS
@andrewharvey
andrewharvey / log-active-x11-window.sh
Created November 1, 2012 11:32
shell script to log details of the current active X11 window
#!/bin/sh
# = About =
# This script when run will log details of the current active X11 window.
# Useful for logging/graphing how much time is spent in different apps.
# = Usage =
# If --datetime is present as the first argument, the log line will include the
# date and time.
#