Skip to content

Instantly share code, notes, and snippets.

upstream kzgeo{
server 127.0.0.1;
}
# NGINX Server Instance
server {
listen 0.0.0.0:80;
server_name kzgeo.spatialdevmo.com;
access_log /var/log/nginx/kzgeo.spatialdevmo.log;
upstream kzapi {
server 127.0.0.1:3333;
}
server {
listen 0.0.0.0:80;
server_name kzapi.spatialdevmo.com;
access_log /var/log/nginx/kzapi.spatialdevmo.log;
# Gzip Compression
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Alpha-Shapes</title>
<script src="http://mbostock.github.com/d3/d3.min.js"></script>
<script src="http://mbostock.github.com/d3/d3.geom.min.js"></script>
<style type="text/css">
path {
@abenrob
abenrob / README.md
Last active December 19, 2015 22:09 — forked from mbostock/.block
Radial Area

This plot might be suitable for showing cyclical trends, though I'm not sure it’s a great idea as the radial display has a number of limitations:

  • The underlying data goes from Sunday to Saturday, but the chart shows continuity from Saturday through to the previous Sunday. Time does not flow backwards, so you might instead prefer to plot two values for Sunday; this would show a discontinuity on opposite sides of the Sunday axis.

  • Displaying the discontinuity requires an open interpolator, rather than cardinal-closed as used here. However, this causes the tangents of the incoming and outgoing lines to no longer be orthogonal to the axis. To display the discontinuity properly, you’d need to write a custom interpolator to generate the correct tangents.

  • Due to the interpolation taking place in Cartesian (rather than polar) coordinates, the intermediate values of the lines do not have the correct radial values: if you tried to measure t

function MercatorToLatLon(mercX, mercY) {
var rMajor = 6378137; //Equatorial Radius, WGS84
var shift = Math.PI * rMajor;
var lon = mercX / shift * 180.0;
var lat = mercY / shift * 180.0;
lat = 180 / Math.PI * (2 * Math.atan(Math.exp(lat * Math.PI / 180.0)) - Math.PI / 2.0);
return { 'Lon': lon, 'Lat': lat };
}
function LatLonToMercator(lat, lon) {
var rMajor = 6378137; //Equatorial Radius, WGS84
var shift = Math.PI * rMajor;
var x = lon * shift / 180;
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
y = y * shift / 180;
return {'X': x, 'Y': y};
}
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
"use strict";
if (this == null) {
throw new TypeError();
}
var t = Object(this);
var len = t.length >>> 0;
if (len === 0) {
import json
from functools import wraps
from flask import redirect, request, current_app
def support_jsonp(f):
"""Wraps JSONified output for JSONP"""
@wraps(f)
def decorated_function(*args, **kwargs):
callback = request.args.get('callback', False)
if callback:
--FROM http://blog.mackerron.com/2012/06/01/postgis-2-ubuntu-12-04/
mkdir -p src
# First install PostgreSQL 9.2, plus contributed packages and any missing prerequisites
# ===
# add the Postgres PPA
echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' \
@abenrob
abenrob / README.md
Last active December 28, 2015 17:39 — forked from mbostock/.block

This donut chart is constructed from a CSV file storing the populations of various age groups. The chart employs a number of D3 features: