- total_pop
- male_pop
- female_pop
- median_age
- white_pop
- black_pop
- asian_pop
- hispanic_pop
- amerindian_pop
- other_race_pop
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
CREATE OR REPLACE FUNCTION CDB_StdDevBins(input numeric[], | |
num_bins INT DEFAULT 5) | |
RETURNS NUMERIC[] | |
AS $$ | |
DECLARE | |
mean_val numeric; | |
stddev_val numeric; | |
out_arr numeric[]; | |
i int; | |
BEGIN |
- Andy Eschbacher, map scientist ([email protected], @MrEPhysics)
- Aaron Steele, SVP ([email protected], @eightysteele)
Andy Eschbacher and Stuart Lynn, map scientists
- Andy: [email protected], @MrEPhysics
- Stuart: [email protected], @Stuart_Lynn
Beautiful Maps
This is an example of Spatial Markov analysis
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
CREATE OR REPLACE FUNCTION cdb_union_adjacent_test(table_name text) | |
RETURNS SETOF geometry As | |
$$ | |
DECLARE | |
intersected_geoms geometry; | |
BEGIN | |
RETURN QUERY EXECUTE 'SELECT ST_Union(g) FROM (SELECT ST_ClusterIntersecting("the_geom") As g FROM ' || table_name || ') As x'; | |
END | |
$$ LANGUAGE 'plpgsql'; |
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
-- first prototype to get summary information of a cluster | |
-- based on the geometries that originally made up the cluster | |
-- clusters are formed from spatially unioning adjacent geometries | |
CREATE OR REPLACE FUNCTION | |
explain_cluster( | |
clustered_geom_table text, | |
unclustered_geom_table text, | |
attrs text) |
Researcher: Andy Eschbacher (@MrEPhysics)
<iframe width="100%" height="520" frameborder="0" src="https://team.cartodb.com/u/eschbacher/viz/6ec87998-da36-11e5-bc31-0ea31932ec1d/embed_map" allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe>
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
CREATE OR REPLACE FUNCTION final_merge_touching( joined_geoms geometry[] ) RETURNS geometry[] AS $$ | |
BEGIN | |
return joined_geoms; | |
END | |
$$ LANGUAGE plpgsql; | |
CREATE OR REPLACE FUNCTION state_merge_touching(clusters geometry[], new_geom geometry) RETURNS geometry[] AS $$ | |
DECLARE | |
joins geometry[] :='{}'; |
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
<!DOCTYPE html><html lang="en"><head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<script>(function () { | |
function resolve() { | |
document.body.removeAttribute('unresolved'); | |
} | |
if (window.WebComponents) { |