Skip to content

Instantly share code, notes, and snippets.

View andrewharvey's full-sized avatar

Andrew Harvey andrewharvey

View GitHub Profile
@andrewharvey
andrewharvey / imagery.geojson
Created February 6, 2025 00:56
NSW Imagery Theme Feb 2025
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andrewharvey
andrewharvey / ColouredStreets_AU.mapcss
Created January 16, 2025 04:49
ColouredStreets with addr:unit/addr:flats support
meta {
title: "Coloured Streets AU";
version: "3.53.127_2021-04-10";
description: "Colouring of buildings, address nodes and streets with the same street name in the same colour. Makes working with addresses a lot easier. Check out the linked page to read how to change some settings of this mappaint style.";
icon: "ColouredStreetsIcon.svg";
author: "geozeisig, Klumbumbus";
link: "https://josm.openstreetmap.de/wiki/Styles/Coloured_Streets";
min-josm-version: "8087"; /* due to @supports */
/* This mapcss mappaint style was created for JOSM 8087. I try to support future versions of JOSM and its internal default mappaint style as long as possible. */
}
@andrewharvey
andrewharvey / polygon-with-a-hole.geojson
Created March 10, 2018 02:21
A GeoJSON Polygon with a hole
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andrewharvey
andrewharvey / index.html
Created February 3, 2024 11:39
Suggested workaround for https://github.com/mapbox/mapbox-gl-js/issues/13067#issuecomment-1925291846 Mapbox GL JS GeolocateControl place marker without initial camera update
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Locate the user</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<link href="https://api.mapbox.com/mapbox-gl-js/v3.1.2/mapbox-gl.css" rel="stylesheet">
<script src="https://api.mapbox.com/mapbox-gl-js/v3.1.2/mapbox-gl.js"></script>
<style>
body { margin: 0; padding: 0; }
@andrewharvey
andrewharvey / mapnik_render_static_map.py
Created October 16, 2011 10:31
Render a static map using Mapnik given centre, zoom and image width/height.
#!/usr/bin/env python
# This script is like generate_image.py from the OSM Mapnik code,
# but it renders based on a given centre point, zoom and final image pixel size
# 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 / math1081.tex
Created September 15, 2012 06:38
UNSW MATH1801, MATH1231 08s2 cheatsheets
% 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/
\documentclass[a4paper,10pt]{article}
\usepackage{verbatim}
\usepackage{amsmath}
\usepackage{amssymb}
\setlength\parindent{0mm}
<!DOCTYPE html>
<html>
<head>
<title>Mapbox GL JS debug page</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.1/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin: 0; padding: 0; }
html, body, #map { height: 100%; }
@andrewharvey
andrewharvey / index.md
Last active May 24, 2023 10:21
Comparison of point and box spatial index libraries for JavaScript
Library Static / Dynamic Cartesian / Geographic kNN Index containing points Index containing boxes Within radius
rbush dynamic 🗺️ cartesian ✔️ ✔️
rbush-knn dynamic 🗺️ cartesian ✔️ ✔️ ✔️ ✔️
kdbush static 🗺️ cartesian ✔️ ✔️
geokdbush static 🌏 geo ✔️ ✔️ ✔️
flatbush static 🗺️ cartesian ✔️ ✔️ ✔️ ✔️
geoflatbush static 🌏 geo ✔️ :heavy_che
@andrewharvey
andrewharvey / README.md
Created September 29, 2012 02:34
Geoscience Australia - Australian Bathymetry and Topography Grid

About

This package contains a set of tools, utilities and stylesheets for working with the Geoscience Australia Australian Bathymetry and Topography Grid.

Here is a sample rendering of this Geoscience Australia Australian Bathymetry and Topography Grid using the process documented in this repository.

Australian Bathymetry and Topography Grid

License

@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