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
<html><body><h1>Summary</h1> <h3>40 Tests Run with 1 Failures - 2012-08-21 11:30</h3> <table border="1"><tr><th>#</th><th>production</th><th>staging</th><th>sql</th><th>carto</th></tr> | |
<tr> | |
<td class="test_count">10</td> | |
<td class="production_img"><a href='http://examples.cartodb.com/tiles/carto_tests/0/0/0.png?style=%23carto_tests+%7Bmarker-fill%3A%23ff7%3B+marker-max-error%3A0.762117952967%3B+marker-line-opacity%3A0.954313683078%3B+marker-allow-overlap%3Afalse%3B+polygon-fill%3Argba%28255%2C+255%2C+0%2C+1%29%3B+marker-spacing%3A16.0%3B+marker-width%3A4.0%3B+marker-height%3A3.0%3B+marker-opacity%3A0.667163700797%3B+line-color%3Agreen%3B+line-gamma%3A0.524514770107%3B+line-cap%3Around%3B+polygon-opacity%3A0.814145908039%3B+marker-type%3Aarrow%3B+polygon-gamma%3A0.296743932444%3B+line-dasharray%3A2%2C10%3B+line-join%3Amiter%3B+marker-placement%3Aline%3B+line-width%3A12.0%3B+marker-line-color%3Argb%28155%2C+133%2C+0%29%3B+line-opacity%3A0.749564105384%3B+marker-line-width%3A4.0%3 |
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 sys | |
args = [] | |
for arg in sys.argv: | |
args.append(arg) | |
try: | |
clr_file = args[1] #'glc2000_v1_1.clr' | |
except: | |
print """ You must supply an input .CLR filename. |
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
--Upload your new raster data | |
--In my case the data goes into a table, night_light | |
--In some cases, I find it useful to downsample the total number of variables in a band, or in some cases merge data from multiple bands into one. | |
--Here is an example how one such process would work | |
UPDATE night_light SET rast = ST_MapAlgebraExpr(rast,'8BUI','CASE WHEN [rast] = 0 THEN 10 WHEN [rast] = 255 THEN 11 ELSE floor([rast]/32)::int END'); | |
--Create a new table, light_polygons | |
--Add a numeric column called, rast_value |
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
// Set the CartoDB user account | |
var CartoDB = Backbone.CartoDB({ | |
user: viz2 | |
}); | |
// Create a model, here directly from SQL | |
// You can also do it with simply a table name and list of columns | |
var parksModel = CartoDB.CartoDBCollection.extend({ | |
sql: "SELECT name FROM nyc_parks ORDER BY ST_Area(the_geom) DESC LIMIT 10" | |
}); |
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
var projectData = { | |
category: 'herbarium', | |
name: 'Southeast Regional Network of Expertise and Collections ', | |
nameshort: 'SERNEC', | |
description: 'SERNEC is an organization devoted to making the resources of these nearly 222 regional Herbaria of the Southeast available online, in concurrence with developing global standards, so that all available data can then be studied regionally or globally as one virtual, researchable collection. SERNEC will improve access to specimen data of a richly biodiverse ecological environment, and provide a platform for herbarium curators and plant scientists to exchange ideas, share expertise, and benefit from the value of information shared across institutions. ', | |
temporalrange: '1800 - present', | |
geography: 'Southeast, United States', | |
taxonomycommon: 'plants', | |
taxonomy: 'Kingdom Plantae', | |
profileimage: '', |
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 sys | |
from os import listdir, path, makedirs | |
from PIL import Image | |
from datetime import datetime | |
try: | |
import simplejson as json | |
except: | |
import json | |
SUPPORTED_FORMATS = ['.tif','.tiff','.png','.jpg'] |
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
#troparevo_nikulino_1 [layer='points']{ | |
marker-fill:#FF3366; | |
marker-width:8; | |
marker-line-color:#000000; | |
marker-line-width:1; | |
marker-opacity:1; | |
marker-line-opacity:1; | |
marker-placement:point; | |
marker-type:ellipse; | |
marker-allow-overlap:true; |
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
WITH | |
setup AS ( | |
SELECT | |
ST_Transform(ST_Buffer(the_geom::geography,n*100)::geometry,3857) the_geom_webmercator, | |
(cars*(10.0 - n)/10.0) as cars | |
FROM troparevo_nikulino_1, generate_series(1,9) n | |
), | |
maxcars AS ( | |
SELECT max(cars)::float as mostcars FROM setup | |
) |
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
-- 1) Create the desired buffer of 50km around your points, buffs | |
-- 2) Create a reprojected envelope around your buffs, area | |
-- 3) Create a rectangular grid inside the envelope, grid | |
-- 4) Select the centroid of each gridcell and reproject it as a a WGS84 point | |
-- The equal area Lambert projection for North America is documented here, | |
-- http://spatialreference.org/ref/sr-org/7314/ | |
-- and is stored in your spatial ref system as, 97314 | |
WITH buffs AS ( --creates a resource called 'area' that will act like any existing table |