Skip to content

Instantly share code, notes, and snippets.

@geobabbler
Created June 6, 2017 19:17
Show Gist options
  • Save geobabbler/28760eb9a0ae32431af30332bb76d073 to your computer and use it in GitHub Desktop.
Save geobabbler/28760eb9a0ae32431af30332bb76d073 to your computer and use it in GitHub Desktop.
SELECT us_hex_grid.id,
count(cellular.id) AS features
FROM us_hex_grid,
cellular
WHERE st_contains(us_hex_grid.shape, cellular.geom)
GROUP BY us_hex_grid.id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment