Skip to content

Instantly share code, notes, and snippets.

View rowanwins's full-sized avatar
🌐
Making maps

Rowan Winsemius rowanwins

🌐
Making maps
  • Canberra, Australia
View GitHub Profile
@rowanwins
rowanwins / turf-shapely.py
Last active June 17, 2017 14:55
Test turf/boolean modules against shapely
from shapely.geometry import asShape
import fiona
import os
import sys
turf_dir = sys.argv[1]
predicate = sys.argv[2]
def runTestOnFile(dir, file, turfResult):
fc = fiona.open(dir + file, 'r')
@rowanwins
rowanwins / fc.geojson
Created December 18, 2018 10:19
Massive Feature Collection
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rowanwins
rowanwins / fc.geojson
Created December 18, 2018 12:35
Simplified FeatureCollection
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rowanwins
rowanwins / sample.geojson
Created February 28, 2019 02:14
mismatchingBaseZ
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rowanwins
rowanwins / sample.geojson
Created February 28, 2019 02:18
Matching Base Z
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rowanwins
rowanwins / data.geojson
Created December 17, 2019 03:33
GeoJson saved from geojson-editor
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"comments": "Matching takes place in the order defined in this file. Place code matches before name matches, and smaller regions before larger ones.",
"regionWmsMap": {
"SPC_EEC_CODE": {
"layerName": "SPC_EEC",
"server": "https://tile-test.terria.io/SPC_EEC/{z}/{x}/{y}.pbf",
"serverType": "MVT", <---- This specifies we'll use mapbox vector tiles
"regionIdsFile": "/data/regionids/region_map-SPC_EEC_CODE_SPC_EEC.json",
"regionProp": "country_id", <----- this is the field in your geographic data containing the unique code
"nameProp": "country_name", <----- this is the field in your geographic data containing a name for the region
@rowanwins
rowanwins / data.geojson
Created April 2, 2020 10:42
GeoJson saved from geojson-editor
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rowanwins
rowanwins / script.turf-sandbox
Created April 23, 2020 04:29
turf-sandbox snippet
// simply return a valid GeoJSON and it will be rendered on the map!
const p = turf.point([0,0])
return p
function radiansToDegrees (radians) {
return radians * (180 / Math.PI)
}
function angleToPoint (p, otherPoint) {
const angleRadians = Math.atan2(otherPoint.y - p.y, otherPoint.x - p.x)
return radiansToDegrees(angleRadians)
}
function scenario1 (anglePrev, angleNext, currentPBearing) {