Author: Sean Gillies Version: 1.0
This document describes a GeoJSON-like protocol for geo-spatial (GIS) vector data.
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
import numpy as np | |
def reflective_kde(x_data: np.ndarray, x_prediction: np.ndarray) -> np.ndarray: | |
h = silverman_bandwidth(x_data) # Compute before adding reflected data | |
x_data_augmented = np.stack((-x_data, x_data, 2-x_data)) | |
reflective_densities = basic_kde(x_data_augmented, x_prediction, h) | |
# Discard left and right reflected samples and normalize density by 1/3 | |
return 3 * reflective_densities | |
# First, clear out any old mapnik or node.js installs that might conflict | |
sudo apt-get purge libmapnik libmapnik-dev mapnik-utils nodejs | |
# Also clear out any old ppa's that might conflict | |
sudo rm /etc/apt/sources.list.d/*mapnik* | |
sudo rm /etc/apt/sources.list.d/*developmentseed* | |
sudo rm /etc/apt/sources.list.d/*chris-lea* | |
# add new ppa's | |
echo 'yes' | sudo apt-add-repository ppa:chris-lea/node.js |
# coding=utf-8 | |
import os, sys, json | |
import numpy as np | |
import matplotlib.pylab as plt | |
from scikits.timeseries.lib.interpolate import * | |
import scikits.statsmodels.sandbox.stats.diagnostic as diag | |
from scikits.statsmodels.tsa.filters import hpfilter | |
import scikits.statsmodels.api as sm | |
def make_reliable(target_ts, reli_ts=None): |
# Graham Scan - Tom Switzer <thomas.switzer@gmail.com> | |
TURN_LEFT, TURN_RIGHT, TURN_NONE = (1, -1, 0) | |
def turn(p, q, r): | |
return cmp((q[0] - p[0])*(r[1] - p[1]) - (r[0] - p[0])*(q[1] - p[1]), 0) | |
def _keep_left(hull, r): | |
while len(hull) > 1 and turn(hull[-2], hull[-1], r) != TURN_LEFT: | |
hull.pop() |
Apparently even a difference of the least precision of the upper left-hand corner causes an alignment error in PostGIS. Consider this example, where I am comparing a land cover raster subset by an MTBS raster and the MTBS raster itself (with the goal being to add the latter to the former, creating the "burned" land cover).
```
SELECT ST_MetaData(r1.rast)
FROM
(SELECT rast
FROM geowepp_burnedarea
WHERE geowepp_burnedarea.rid = 2) r1
UNION
SELECT ST_MetaData(r2.rast)
function Stats(arr) { | |
var self = this; | |
var theArray = arr || []; | |
//http://en.wikipedia.org/wiki/Mean#Arithmetic_mean_.28AM.29 | |
self.getArithmeticMean = function() { | |
var sum = 0, length = theArray.length; | |
for(var i=0;i<length;i++) { | |
sum += theArray[i]; | |
} |