Skip to content

Instantly share code, notes, and snippets.

@almccon
Last active May 5, 2016 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almccon/23529646dba75d3a014e84ba501b9b3b to your computer and use it in GitHub Desktop.
Save almccon/23529646dba75d3a014e84ba501b9b3b to your computer and use it in GitHub Desktop.
Reproject USA + Alaska & Hawaii moved
<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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment