Most maps that we see on the web use the Web Mercator projection. Web Mercator gained its popularity because it provides an efficient way for a two-dimensional flat map to be chopped up into seamless 256x256 pixel map tiles that load quickly into the rectangular shape of your browser.
If you asked a cartographer which map projection you should choose for your map, most of the time the answer would not be Web Mercator. What projection you choose depends on your map’s extent, the type of data you are mapping, and as with all maps, the story you want to tell.
Well, get excited because with a few lines of SQL in CARTO, you can free your maps from Web Mercator!
This blog covers how you can go from the standard Web Mercator:
To Albers Equal Area Conic (a popular choice for thematic maps of North America):
Every CARTO account comes with a set of default projections. Even if the projection you are looking for isn’t in the default set, no problem! In a few steps, you can start using nearly any projection you want for your web maps.
Even better, this is all done on the fly and you can project the same dataset in multiple ways for different maps.
For a more detailed discussion on projections, see [this tutorial].
Let’s start by accessing the list of default projections available in CARTO:
What you will see is a table load with all of the projections that you can use for your maps. Take some time to sort through the table to see what is available. As mentioned before, even if you don’t see the projection you are looking for, its ok!
Our final map is in Albers Equal Area Conic centered on North America. I know this projection isn’t in the default list, so let’s add it.
To add a projection, we need to insert its definition into the
spatial_ref_sys table. There are a couple of great websites out there where you can copy and paste the definition that you need. Two of the ones that I’ve found most useful are spatialreference.org and epsg.io.
Now that we have added the projection definition to CARTO, we can use its SRID to project any data layers on the fly. In this example, we’ll use two datasets from Natural Earth (land and ocean) that are available in CARTO’s Data Library.
ne_50minto the data search bar
ne_50m_land) and Ocean (
ne_50m_ocean) and click the option to CREATE MAP
ST_Transformand the projection’s SRID
The land and ocean datasets should now be projected and your map probably looks something like this:
Ok! Let’s add some final touches to the map.
#FFFFFF) for your Custom color
And here is our final map! (If you would like to add graticule lines to your map you can download them from Natural Earth, and add the
ST_Transform SQL from above.)
In the coming weeks, look for more detailed blog posts going over some advanced cartographic effects on a variety of maps… most of which are NOT Web Mercator!
And for fun, here are some other projections that you might like to use in your maps. This CartoDBlock has a more detailed overview with links to the projection text and SQL examples.
North Pole Azimuthal Equidistant
Lambert Conformal Conic centered on Asia
Understand how to improve your business achievement and make better, and faster decisions with CARTO Builder.
You have probably heard about Microsoft’s work this past year, in training a neural network to polygonize satellite imagery into building footprints. This work resulted in ...Cartography & Visualization
Please fill out the below form and we'll be in touch real soon.