View google-earth-perspective-to-geojson.js
#!/usr/bin/env osascript -l JavaScript
// usage: google-earth-perspective-to-geojson.js xSamples ySamples > currentPerspective.geojson
function run(argv) {
var xSamples = argv[0] || 50;
var ySamples = argv[1] || 50;
var ge = Application('Google Earth Pro');
View copygeo.py
#!/usr/bin/env python
# This script copies georeferencing information from one file to another that has none,
# via the creation of an .aux.xml file (so it should work with any image format).
# This is useful if, for example, you've edited a GeoTIFF in Photoshop,
# and saved the result as a JPG that you'd still like to be geo-aware for use
# with GDAL or QGIS.
# Requires GDAL command line tools, because re-making gdalbuildvrt in python
View closest_point_on_perimeter_of_rectangle.js
// translated from http://stackoverflow.com/questions/20453545/how-to-find-the-nearest-point-in-the-perimeter-of-a-rectangle-to-a-given-point
function clamp(n,lower,upper) {
return Math.max(lower, Math.min(upper, n));
}
function getNearestPointInPerimeter(l,t,w,h,x,y) {
var r = l+w,
b = t+h;
View remove_googledocs_page_breaks.css
#docs-editor-container .kix-page-compact::before {
border-top: none;
}
View lockView.js
// Looks an element up by CSS selector and keeps it centered in the viewport on window resize
// Useful for testing responsive versions of specific DOM elements
// if jquery isn't loaded on the page, paste this code into the console first to load it:
var jqURL = 'http://code.jquery.com/jquery-latest.min.js';
var jqscript = document.createElement('script');
jqscript.type= 'text/javascript';
jqscript.src = jqURL;
document.head.appendChild(jqscript);
View README.md

Experiments faking 3d rotation of a globe and sun in SVG. Illusion is helped by dynamic gradients, two nested orthographic projections, scaling the sun circle's radius based on distance from the 'camera', and toggling a clipping mask that makes the sun appear to move "behind" the earth.

Based on Mike Bostock's Solar Terminator and this past experiment.

This example stems from drafts of maps for Norway the Slow Way. Also see Mike's Pencil Sketch example.

View gist:2a6fb6f57850ef6e2829
http://chimera.labs.oreilly.com/books/1230000000345/ (full book online)
https://www.dashingd3js.com/table-of-contents
http://vadim.ogievetsky.com/IntroD3/#1
http://www.jeromecukier.net/blog/2012/09/04/getting-to-hello-world-with-d3/
http://www.jeromecukier.net/blog/2013/03/05/d3-tutorial-at-strata-redux/
http://www.jeromecukier.net/blog/2012/05/28/manipulating-data-like-a-boss-with-d3/
http://www.jeromecukier.net/blog/2011/08/11/d3-scales-and-color/
http://blog.visual.ly/creating-animations-and-transitions-with-d3-js/
http://code.hazzens.com/d3tut/lesson_1.html
http://bost.ocks.org/mike/map/
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.counties {
fill: none;
stroke: black;
opacity:0.2;
}
View l8_pansharp.sh
# These are shell functions to quickly create pansharpened RGB images ready for color correction
# from a set of raw Landsat 8 TIF files in a given directory.
# For example:
# l8_pansharp LC81690352014169LGN00
# Creates:
# LC81690352014169LGN00_rgb_pansharp.tif
# l8_rush_pansharp downloads a L8 tile from Google Storage (if they have it), extracts the relevant bands, then creates the pansharpened output.
View l8get
# This is a shell function to quickly grab the data for a given Landsat 8 tile ID from Google's servers
# For example:
# l8get LC81690352014169LGN00
# The echo at the end is to remind myself of the syntax for extracting bands 8, 4, 3, and 2. (Pansharp, Red, Green, Blue)
# On OSX this would go into your ~/.bash_profile file.
# Requires gsutil from https://developers.google.com/storage/docs/gsutil_install
# Most useful in conjunction with USGS' Earth Explorer: http://earthexplorer.usgs.gov/