Created
October 20, 2016 10:44
-
-
Save ramiroaznar/e150bf13af9ca085c8089962a27a2b16 to your computer and use it in GitHub Desktop.
Stacking Chips v2 SQL query & CartoCSS Style
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 | |
m AS (SELECT count(*) n, array_agg(cartodb_id) id_list, the_geom_webmercator, ST_Y(the_geom_webmercator) y FROM copia_de_victimas GROUP BY the_geom_webmercator ORDER BY y DESC) , | |
f AS (SELECT n, generate_series(1, array_length(id_list,1)) p, unnest(id_list) cartodb_id, the_geom_webmercator FROM m) | |
SELECT | |
t.the_geom_webmercator, | |
t.the_geom, | |
f.cartodb_id, | |
f.p, | |
t.profesion | |
FROM f, copia_de_victimas t | |
WHERE f.cartodb_id = t.cartodb_id |
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
Map{ | |
buffer-size:2048px; | |
} | |
#layer { | |
/* the first line only would work with BUILDER */ | |
marker-fill: ramp([profesion], (#5B3F95, #1D6996, #129C63, #73AF48, #EDAD08, #E17C05, #C94034, #BA0040, #8E1966, #6F3072, #DC1721), category(10)); | |
marker-fill-opacity: 1; | |
marker-line-color: #424141; | |
marker-line-width: 0.6; | |
marker-line-opacity: 1; | |
marker-placement: point; | |
marker-type: ellipse; | |
marker-width: 10; | |
marker-height: 8; | |
marker-allow-overlap: true; | |
[p>1] { | |
marker-transform: translate(0, -2*([p]-1)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Te falta la licencia del código (https://gist.github.com/AbelVM/c4cf55f6816467cb45fa) y la referencia a quien tuvo la idea (https://github.com/chriswhong), no? :trollinginthedeep: