Created
February 26, 2014 19:09
-
-
Save wboykinm/9236270 to your computer and use it in GitHub Desktop.
Cartodb call to get count and density of points in each census block polygon
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
SELECT dane_county_blocks_stats.the_geom_webmercator as the_geom_webmercator, count(i.cartodb_id) as points_count, count(i.cartodb_id)/ST_Area(dane_county_blocks_stats.the_geom_webmercator) | |
as points_density, 1 as cartodb_id FROM dane_county_blocks_stats, (select * from dane_cty_hhs) i where ST_Intersects(i.the_geom_webmercator, dane_county_blocks_stats.the_geom_webmercator) GROUP BY dane_county_blocks_stats.the_geom_webmercator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment