SELECT
ntile,
CAST(avg(length) AS INTEGER) AS avgAmount,
CAST(max(length) AS INTEGER) AS maxAmount,
CAST(min(length) AS INTEGER) AS minAmount
FROM (SELECT length, ntile(6) OVER (ORDER BY length) AS ntile FROM countries) x
GROUP BY ntile
ORDER BY ntile;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 urllib2, urllib | |
import re, os | |
import sqlite3 | |
import uuid | |
import contextlib | |
from bs4 import * | |
import csv | |
import unicodedata |
This file contains 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 scraperwiki | |
import urllib2, urllib | |
import re, os | |
import sqlite3 | |
import uuid | |
from bs4 import * | |
import lxml | |
import unicodedata | |
from time import sleep |
This script processes VIIRS Nighttime Lights 2012 GeoTIFFs from the Earth Observation Group at NOAA National Geophysical Data Center to prepare them for rendering in TileMill and uploading to MapBox Hosting.
Read Lights of the Night on MapBox to learn more about NPP the functions of this script.
- Tilemill (also available for Windows from this link).
- Quantum GIS, but you'll want to install the dependencies first: GDAL Complete 1.9 framework package and GSL framework
- Open Office - This is optional -- any other spreadsheet editor works, often google docs is enough.
This file contains 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
mapbox.load('herwig.map-siz5m7we', function(o) { | |
var map = mapbox.map('map'); | |
map.addLayer(o.layer); | |
map.zoom(4).center({ | |
lat: -28.613, | |
lon: 144.14 | |
}).setPanLimits([{ | |
lat: -85.0511, | |
lon: -180 | |
}, { |
This file contains 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
from osgeo import osr | |
srs = osr.SpatialReference() | |
wkt_text = 'PROJCS["Transverse Mercator",GEOGCS["GCS_Everest_1830",DATUM["D_Everest_1830",SPHEROID["Everest_1830",6377299.36,300.8017]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500295.0],PARAMETER["False_Northing",-2000090.0],PARAMETER["Central_Meridian",90.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]' | |
srs.importFromWkt(wkt_text) | |
srs.ExportToProj4() |