This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sqlite3 -separator ',' offline.db 'select x,y,z from tiles;' | sed 's/^/[/' | sed 's/$/]/' | mercantile shapes --indent 2 > offline.tiles.geojson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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%; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query.sql: parcels.txt | |
cat parcels.txt | sed 's/Lot /(lotnumber = \'/' | sed -E 's/ DP ?/\' and plannumber = /' | sed 's/$/) or /' | tr -d '\n' | sed 's/ or $//'> query.sql | |
reserve.geojson: | |
wget -O reserve.geojson 'https://maps.six.nsw.gov.au/arcgis/rest/services/public/NSW_Cadastre/MapServer/9/query?where=%28lotnumber+%3D+%272%27+and+plannumber+%3D+778317%29+or+%28lotnumber+%3D+%277014%27+and+plannumber+%3D+1020484%29+or+%28lotnumber+%3D+%277311%27+and+plannumber+%3D+1154270%29+or+%28lotnumber+%3D+%277312%27+and+plannumber+%3D+1154269%29+or+%28lotnumber+%3D+%277313%27+and+plannumber+%3D+1154269%29+or+%28lotnumber+%3D+%277301%27+and+plannumber+%3D+1123766%29+or+%28lotnumber+%3D+%277033%27+and+plannumber+%3D+1051528%29+or+%28lotnumber+%3D+%277015%27+and+plannumber+%3D+1051527%29+or+%28lotnumber+%3D+%271%27+and+plannumber+%3D+778317%29+or+%28lotnumber+%3D+%277018%27+and+plannumber+%3D+1051736%29+or+%28lotnumber+%3D+%277019%27+and+plannumber+%3D+1051736%29+or+%28lotnumber+%3D+%27266%27+and+plannumber+%3D+7516 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -O - https://elvis-ga.fmecloud.com/fmedatastreaming/elvis_indexes/ReturnDownloadables.fmw | jq -r '.available_data[].downloadables.DEMs."1 Metre"[].bbox' | xargs -I '{}' turf bboxPolygon "[{}]" | tr -d '\n ' | sed 's/}{/},{/' | sed 's/^/{"type": "FeatureCollection", "features": [/' | sed 's/$/]}/' > elvisBBOX.geojson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://s3-ap-southeast-2.amazonaws.com/opendata-aerial-imagery/mga55_gda94_10cm_2018_CoM_true_ortho.zip | |
unzip mga55_gda94_10cm_2018_CoM_true_ortho.zip | |
rm mga55_gda94_10cm_2018_CoM_true_ortho.zip | |
gdalwarp -multi -wo NUM_THREADS=ALL_CPUS -r lanczos -t_srs 'EPSG:3857' -co COMPRESS=JPEG -co TILED=YES mga55_gda94_10cm_2018_CoM_true_ortho/mga55_gda94_10cm_2018_CoM_true_ortho.jp2 CoM_10cm_May_2018_EPSG3857.tiff | |
# the alpha band is being misunderstood by most software, creating a transpaent image, so we can just ignore the alpha band | |
gdal_translate -co COMPRESS=JPEG -b 1 -b 2 -b 3 CoM_10cm_May_2018_EPSG3857.tiff CoM_10cm_May_2018_EPSG3857_RGB.tiff | |
# You may find it easier to run this on the Docker image at https://hub.docker.com/r/klokantech/gdal/ which has various JP2 drivers installed | |
# docker run -ti --rm -v $(pwd):/data klokantech/gdal gdalwarp ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<title>Mapbox GL Draw Rectangle</title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.49.0/mapbox-gl.js'></script> | |
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.49.0/mapbox-gl.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<title>NSW 1943 vs now</title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.49.0/mapbox-gl.js'></script> | |
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.49.0/mapbox-gl.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var process = require('process'); | |
process.env.UV_THREADPOOL_SIZE = Math.ceil(require('os').cpus().length * 1.5); | |
var OSRM = require('osrm'); | |
var path = require('path'); | |
var fs = require('fs'); | |
var d3 = require('d3'); | |
var async = require('async'); |
This file has been truncated, but you can view the full file.