Skip to content

Instantly share code, notes, and snippets.

View morganherlocker's full-sized avatar
☠️
computing

Morgan Herlocker morganherlocker

☠️
computing
View GitHub Profile
  • greenland
  • norway
  • russia
  • sweden
  • tanzania
  • usa
  • zambia
  • algeria

x1,y1,x2,y2 | x3,y3,x4,y4

vertical into horizontal

return x1, y3

horizontal into segment

scan point - z6 - z6 x 10,966,437 ops/sec ±3.60% (22 runs sampled)
scan road - z6 - z6 x 298,475 ops/sec ±0.66% (23 runs sampled)
scan road - z8 - z8 x 289,472 ops/sec ±2.35% (21 runs sampled)
scan road - z10 - z10 x 295,153 ops/sec ±0.67% (22 runs sampled)
scan road - z12 - z12 x 289,679 ops/sec ±1.77% (23 runs sampled)
scan road - z18 - z18 x 59,491 ops/sec ±1.13% (23 runs sampled)
scan road - z20 - z20 x 22,169 ops/sec ±1.29% (22 runs sampled)
scan road - z25 - z25 x 250 ops/sec ±1.12% (22 runs sampled)
scan road - z28 - z28 x 64.03 ops/sec ±1.02% (17 runs sampled)
scan building - z6 - z6 x 100,749 ops/sec ±1.18% (24 runs sampled)

drivetime polygons

##algorithm

  1. create a grid around a point; grid should be (2*(minutes*0.8)) miles wide (assuming max speed is 70mph)
  2. get the eta from the point to each gridpoint
  3. run marching squares over the grid at the desired drive time

##notes

//
// FelkelStraightSkeleton.cpp: implementation of the vtStraightSkeleton class.
//
// Copyright (c) 2003-2009 Virtual Terrain Project
// Free for all uses, see license.txt for details.
//
// Straight skeleton algorithm and original implementation
// courtesy of Petr Felkel and Stepan Obdrzalek (petr.felkel@tiani.com)
// Re-implemented for the Virtual Terrain Project (vterrain.org)
// by Roger James (www.beardandsandals.co.uk)
var average = require('turf-average')
var sum = require('turf-sum')
var median = require('turf-median')
var min = require('turf-min')
var max = require('turf-max')
var deviation = require('turf-deviation')
var variance = require('turf-variance')
var count = require('turf-count')
var turf = {}
turf.average = average
ITEM STUB
DPSF1. SEX AND AGE [57]
Universe: Total population
DP0010001 Total:
DP0010002 Under 5 years
DP0010003 5 to 9 years
DP0010004 10 to 14 years
DP0010005 15 to 19 years
DP0010006 20 to 24 years
DP0010007 25 to 29 years
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.simplify=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"/Users/morgan/Documents/projects/turfjs/turf/turf_modules/turf-simplify/index.js":[function(require,module,exports){
var simplify = require('simplify-js');
/**
* Simplifies a {@link Feature} containing a {@link LineString} or
* {@link Polygon} geomet