LDFLAGS="-I<path-to-openssl>/include -L<path-to-openssl>/lib" pip install psycopg2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css"/> | |
<style> | |
#mapid{ | |
height: 480px; | |
} | |
#download { | |
position:absolute; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
requires: | |
- mapnik 3.x and its python bindings (https://github.com/mapnik/mapnik) | |
- mercantile==0.9.0 (https://github.com/mapbox/mercantile) | |
""" | |
import os | |
import mapnik | |
import mercantile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loadDependencies(deps, callback) { | |
var dep = deps.shift(); | |
if (dep['script'] && typeof(window[dep['lib']]) != dep['loadType'] || 'function') { | |
var depScript = document.createElement('script'); | |
depScript.type = 'text/javascript'; | |
depScript.src = dep['script']; | |
(document.getElementsByTagName('head')[0]).appendChild(depScript); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getStyles(doc) { | |
/** idea from https://github.com/NYTimes/svg-crowbar **/ | |
var styles = '', | |
styleSheets = doc.styleSheets; | |
if (styleSheets) { | |
for (var i = 0; i < styleSheets.length; i++) { | |
processStyleSheet(styleSheets[i]); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cssInliner(el) { | |
var cssProperties = getComputedStyle(el, null); | |
var cssText = ''; | |
for (var i = 0; i < cssProperties.length; i++) { | |
cssText += cssProperties[i] + ':' + cssProperties.getPropertyValue(cssProperties[i]) + ';' | |
} | |
el.style.cssText = cssText; | |
for (var j = 0; j < el.childElementCount; j++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# requires pyproj and shapely | |
import collections | |
import functools | |
import math | |
import random | |
import pyproj | |
from shapely.geometry import box, point, polygon | |
from shapely.ops import transform |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION ST_CreateFishNet( | |
IN xsize double precision, | |
IN ysize double precision, | |
IN north double precision DEFAULT 0, | |
IN east double precision DEFAULT 0, | |
IN south double precision DEFAULT 1, | |
IN west double precision DEFAULT 1) | |
RETURNS SETOF geometry AS | |
$BODY$ | |
SELECT ST_Translate(cell, $6 + (i * $1), $5 + (j * $2)) AS geom |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
from qgis.core import * | |
from PyQt4.QtGui import * | |
home = os.path.expanduser('~') | |
sys.path.extend([ | |
'/usr/share/qgis/python/plugins/processing', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION ST_GridFromBbox( | |
IN x0 double precision, | |
IN y0 double precision, | |
IN x1 double precision, | |
IN y1 double precision, | |
IN xsize double precision, | |
IN ysize double precision, | |
OUT "row" integer, | |
OUT col integer, | |
OUT geom geometry) |
OlderNewer