By default, maps created in CARTO use the Web Mercator projection. All maps are projections - a way to represent the "spherical" Earth as a flat representation in a browser. The Albers projection is a popular map projection for the US because it creates minimal distortions for most of the country.
In CARTO, geometries are stored using the WGS84 projection, which uses
the_geom column. To show data on a map, the Web Mercator projection makes it easy to quickly transform your data into pixels. Web Mercator versions of your data are pre-stored in a hidden column, called
This guide describes how to quickly project your map and data with the Albers projection, instead of the default, Web Mercator.
Create a a map from the
cb_2013_us_county_500k dataset, showing all USA counties and their information. This dataset is available from CARTO's Data Library when connecting a dataset. The map opens in the Builder, displaying polygon geometries for the map layer.
When using a different projection in CARTO other than Web Mercator, you must change the default basemap in order to better visualize state borders. It is recommended to select a color as your basemap.
Click on the default basemap to view the basemap options.
Select COLOR as the basemap source and select black as the background color.
The SQL option is available from CARTO Builder when a map layer is selected.
SELECT ST_Transform(the_geom_webmercator, 2163) AS the_geom_webmercator, cartodb_id, the_geom, affgeoid, cd113fp, countyfp, geoid, statefp FROM cb_2013_us_county_500k
This SQL query applied the ST_Transform PostGIS function, which returns the geometry with coordinates transformed to the Albers projection. ST_Transform takes the hidden column (
the_geom_webmercator) and the ID number for the Spatial Reference System being applied (the Albers projection, SRID 2163).
We would love to hear from you! Was it easy to understand? Do you need more information? Let us know.