Skip to content

Instantly share code, notes, and snippets.

@saleiva
Created March 5, 2012 10:58
Show Gist options
  • Save saleiva/1977875 to your computer and use it in GitHub Desktop.
Save saleiva/1977875 to your computer and use it in GitHub Desktop.
11870.com hotels density map in Madrid
SELECT count(cartodb_id) as ct, ST_Transform(ST_Buffer(ST_SnapToGrid(the_geom,0.002),0.001, ‘quad_segs=2 endcap=square’),3857) as the_geom_webmercator FROM hoteles_playground GROUP BY ST_SnapToGrid(the_geom,0.002)
#hoteles_playground{
polygon-fill:#FF6600;
polygon-opacity:.7;
}
#hoteles_playground[ct<=40]{
polygon-fill:#BD0026}
#hoteles_playground[ct<=20]{
polygon-fill:#F03B20}
#hoteles_playground[ct<=13]{
polygon-fill:#FD8D3C}
#hoteles_playground[ct<=7]{
polygon-fill:#FEB24C}
#hoteles_playground[ct<=3]{
polygon-fill:#FED976}
#hoteles_playground[ct<=2]{
polygon-fill:#FFFFB2
}
@saleiva
Copy link
Author

saleiva commented Mar 20, 2012

Hey! That's cool! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment