Skip to content

Instantly share code, notes, and snippets.

View andrewharvey's full-sized avatar

Andrew Harvey andrewharvey

View GitHub Profile
@andrewharvey
andrewharvey / README.md
Last active January 18, 2020 23:40
Maxar 2020 Australian Bushfire Imagery
@andrewharvey
andrewharvey / README.md
Created January 7, 2020 07:05
Compare a road network to OpenStreetMap
wget http://download.openstreetmap.fr/extracts/oceania/australia/new_south_wales.osm.pbf
osmium tags-filter new_south_wales.osm.pbf w/highway -o nsw-roads.osm.pbf
osmium export -o nsw-roads.geojson nsw-roads.osm.pbf
ogr2ogr -f GPKG nsw-roads.gpkg nsw-roads.geojson
ogr2ogr -dialect OGRSQL -sql "SELECT geom FROM \"nsw-roads\" WHERE OGR_GEOMETRY='LineString'" nsw-roads.shp nsw-roads.gpkg

# in QGIS
# Vector > Geoprocessing Tools > Buffer
# buffer distance 0.0005
@andrewharvey
andrewharvey / index.html
Created November 12, 2019 10:27
Mapbox GL JS Workshop Custom Layer
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.5.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.5.0/mapbox-gl.css' rel='stylesheet' />
<script src='https://unpkg.com/three@0.106.2/build/three.min.js'></script>
<script src="https://unpkg.com/three@0.106.2/examples/js/loaders/GLTFLoader.js"></script>
@andrewharvey
andrewharvey / index.html
Created November 12, 2019 03:53
Mapbox GL JS Workshop
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.5.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.5.0/mapbox-gl.css' rel='stylesheet' />
<style>
body {
@andrewharvey
andrewharvey / index.html
Created September 27, 2019 12:02
Mapbox GL JS look at elevation example
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Look at Elevation</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.3.2/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.3.2/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@andrewharvey
andrewharvey / polygon-with-a-hole.geojson
Created August 24, 2019 09:39
GeoJSON Polygon with a hole
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andrewharvey
andrewharvey / polygon-clipping-bug.geojson
Created July 30, 2019 04:29
polygon-clipping-bug.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Display a map</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@andrewharvey
andrewharvey / 10_955_618.pbf
Last active June 26, 2019 06:01
mapbox-gl-symbol-bug
@andrewharvey
andrewharvey / mbgl-offline-geojson-tiles
Created March 4, 2019 14:10
Inspect an mbgl-offline pack and generate a GeoJSON of the containing tiles
#!/bin/sh
sqlite3 -separator ',' offline.db 'select x,y,z from tiles;' | sed 's/^/[/' | sed 's/$/]/' | mercantile shapes --indent 2 > offline.tiles.geojson