SQL for CartoDB to reproject the USA, with Alaska and Hawaii moved to the southwest of the lower 48
Modified from https://gist.github.com/ohasselblad/223582a53d5960c50a86
SQL for CartoDB to reproject the USA, with Alaska and Hawaii moved to the southwest of the lower 48
Modified from https://gist.github.com/ohasselblad/223582a53d5960c50a86
<html> | |
<head> | |
<body> | |
<img src="https://gist.githubusercontent.com/almccon/23529646dba75d3a014e84ba501b9b3b/raw/3dcc3108ba0efc3ce50725dfc1bb941077164304/preview.png"> | |
</body> | |
</html> |
SELECT | |
CASE | |
WHEN name != 'Alaska' AND name != 'Hawaii' | |
THEN ST_Transform(the_geom_webmercator,2163) | |
WHEN name = 'Alaska' | |
THEN | |
ST_Translate(ST_Scale( | |
ST_Transform( | |
the_geom | |
,3338 | |
) | |
, 0.5 | |
, 0.5 | |
),-2000000,-2500000) | |
WHEN name = 'Hawaii' | |
THEN | |
ST_Translate(ST_Scale( | |
ST_Transform( | |
the_geom | |
,26961 | |
) | |
, 1.0 | |
, 1.0 | |
),-1200000,-2200000) | |
END the_geom_webmercator | |
, cartodb_id | |
FROM ne_50m_admin_1_states |