Skip to content

Instantly share code, notes, and snippets.

View morganherlocker's full-sized avatar
☠️
computing

Morgan Herlocker morganherlocker

☠️
computing
View GitHub Profile
@morganherlocker
morganherlocker / bay_to_breakers.geojson
Last active August 2, 2021 07:51
turf buffer example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"distance": 0.04162350800625099,
"curve": 0.009039173454286032,
"oneway=yes": 1.0,
"highway=trunk_link": 0.0,
"highway=primary": 0.0,
"lanes=2": 0.0,
"maxspeed=35 mph": 0.0,
"lanes=3": 0.0,
"highway=secondary": 0.0,
  • Contributor: @morganherlocker
  • Task: Hausdorf Distance
  • Issue: Turfjs/turf#1286
  • Estimated Time: 5 hours
  • Deadline: 3/10/18
  • Requested Budget: $50
  • Impact: Allows you to compare the similarity between two lines to find the most similar in a Collection or Set of lines.
cat line-delimitted-geo-data.json | node to-collection.js > valid-geojson.json
@morganherlocker
morganherlocker / Effects Pedal hacking 101.md
Last active October 11, 2017 19:47
Effects Pedal hacking 101

General:

  • start simple
  • start with fuzz
  • don't even bother looking at building an analog delay pedal yet :)

All you really need to know about electrical components:

Resistors

JSON.stringify(require('tilebelt').tileToGeoJSON(require('tilebelt').quadkeyToTile('1231002')))
var through2 = require('through2')
var byline = require('byline')
process.stdin
.pipe(byline.createStream())
.pipe(through2(function(chunk, enc, next){
var data = JSON.parse(chunk.toString())
this.push(toGeoJSON(data))
var through2 = require('through2')
var fs = require('fs')
var byline = require('byline')
var combine = through2(function(chunk, enc, next){
console.log(chunk.toString())
console.log('--')
next()
})
var fc = // ... a featurecollection of polygons and multipolygons
var polys = turf.featurecollection([])
fc.features.forEach(function(poly){
if (poly.geometry.type === 'Polygon') {
polys.features.push(poly)
} else if (poly.geometry.type === 'MultiPolygon') {
// start max area at -Infinity
var max = {
var cover = require('tile-cover')
var tilebelt = require('tilebelt')
var turf = require('@turf/turf')
var features = [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",