Skip to content

Instantly share code, notes, and snippets.

@makella
Last active November 5, 2019 18:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makella/ebdd0c7510c94386531fd61397cbb8d4 to your computer and use it in GitHub Desktop.
Save makella/ebdd0c7510c94386531fd61397cbb8d4 to your computer and use it in GitHub Desktop.
Equal Earth Projection in CARTO

Equal Earth Projection in CARTO!

Screen Shot 2019-11-05 at 11 31 42 AM

The recent release of PostGIS 3.0 brings an updated spatial reference system table that includes over 8000 projections out of the box and we're happy to report that the Equal Earth Projection is one of them!

As a CARTO user, this means you can start using this popular projection in your maps right away!

Getting Started

A future update will bring all 8000 projections to CARTO automatically, but for now, you have to add them manually to your account's spatial_ref_sys table. The most straight forward way to do this is through your Dashboard.

From the Data view, click on any table to open it. Copy the projection's definition below and paste it in the SQL pane and click Apply.

INSERT INTO 
  "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") 
VALUES 
  (8857,'EPSG',8857,'','+proj=eqearth +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs')

Once you've done that, you can start using the projection with the SRID 8857.

To learn more about adding projections into your spatial reference table with CARTO visit this advanced cartography resource.

Examples

Below are links with examples using the Equal Earth Projection in CARTO Builder, CARTO VL, and CARTOframes.

Builder Map

.carto file download

CARTO VL Map

https://bl.ocks.org/makella/ffcd3be98c5354d384008528d0e11fe7

CARTOframes Colab Notebook

https://colab.research.google.com/drive/1BMXjankqpe4oc7yZIFLquy5-hF66JKol

More options

The option above, centers the map on 0,0 but if you want to vary the central meridian, there are a couple of additional options:

EPSG 8858 : WGS 84 / Equal Earth Americas

INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (8858,'EPSG',8858,'','+proj=eqearth +lon_0=-90 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs')

EPSG 8859 : WGS 84 / Equal Earth Asia-Pacific

INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (8859,'EPSG',8859,'','+proj=eqearth +lon_0=150 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs')
@makella
Copy link
Author

makella commented Nov 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment