Skip to content

Instantly share code, notes, and snippets.

View ianscrivener's full-sized avatar

Ian Scrivener ianscrivener

View GitHub Profile
@mourner
mourner / TileLayer.Common.js
Created February 11, 2012 23:11
Leaflet shortcuts for common tile providers
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {
L.TileLayer.prototype.initialize.call(this, this.url, options);
}
});
(function () {
@jgomezdans
jgomezdans / calc_ndvi_gdal.py
Created February 24, 2016 16:23
Simple script to calculate NDVI using pure GDAL
from osgeo import gdal
import numpy
g = gdal.Open ("baikal_subset.tif")
if g is None:
raise IOError, "Couldn't open baikal_subset.tif"
b3 = g.GetRasterBand(3).ReadAsArray().astype(np.float32)
b4 = g.GetRasterBand(4).ReadAsArray().astype(np.float32)