Created
July 21, 2017 08:48
-
-
Save ramiroaznar/7a1ff6dbf64087767ef422bf8bfe55fa to your computer and use it in GitHub Desktop.
Buffer radious based on earthquake magnitude
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 | |
cartodb_id, | |
'minor' as type, | |
ST_Buffer(the_geom::geography, 100000)::geometry) AS the_geom, | |
ST_Transform(ST_Buffer(the_geom::geography, 100000)::geometry, 3857) AS the_geom_webmercator | |
from | |
all_day | |
where | |
mag <= 2.9 | |
UNION ALL | |
select | |
cartodb_id, | |
'light' as type, | |
ST_Buffer(the_geom::geography, 100000)::geometry) AS the_geom, | |
ST_Transform(ST_Buffer(the_geom::geography, 300000)::geometry, 3857) AS the_geom_webmercator | |
from | |
all_day | |
where | |
mag > 2.9 and mag <= 3.9 | |
UNION ALL | |
select | |
cartodb_id, | |
'moderate' as type, | |
ST_Buffer(the_geom::geography, 100000)::geometry) AS the_geom, | |
ST_Transform(ST_Buffer(the_geom::geography, 500000)::geometry, 3857) AS the_geom_webmercator | |
from | |
all_day | |
where | |
mag > 3.9 and mag <= 4.9 | |
UNION ALL | |
select | |
cartodb_id, | |
'strong' as type, | |
ST_Buffer(the_geom::geography, 100000)::geometry) AS the_geom, | |
ST_Transform(ST_Buffer(the_geom::geography, 700000)::geometry, 3857) AS the_geom_webmercator | |
from | |
all_day | |
where | |
mag > 4.9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment