Skip to content

Instantly share code, notes, and snippets.

Andrew Harvey andrewharvey

Block or report user

Report or block andrewharvey

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@andrewharvey
andrewharvey / README.md
Last active Jan 18, 2020
Maxar 2020 Australian Bushfire Imagery
View README.md
@andrewharvey
andrewharvey / README.md
Created Jan 7, 2020
Compare a road network to OpenStreetMap
View README.md
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 Nov 12, 2019
Mapbox GL JS Workshop Custom Layer
View index.html
<!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 Nov 12, 2019
Mapbox GL JS Workshop
View index.html
<!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 Sep 27, 2019
Mapbox GL JS look at elevation example
View index.html
<!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; }
View polygon-with-a-hole.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View 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.
View index.html
<!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 / mbgl-offline-geojson-tiles
Created Mar 4, 2019
Inspect an mbgl-offline pack and generate a GeoJSON of the containing tiles
View mbgl-offline-geojson-tiles
#!/bin/sh
sqlite3 -separator ',' offline.db 'select x,y,z from tiles;' | sed 's/^/[/' | sed 's/$/]/' | mercantile shapes --indent 2 > offline.tiles.geojson
You can’t perform that action at this time.