Web map projections: the bare minimum you need to know
TileMill wants to know: what projection is this data?
If you’re making maps, you will probably need to know something about cartographic projections. Here’s the minimum.
- The globe is round, maps are flat. Each of the hundreds of different methods for converting from round to flat is a projection.
- When you have a latitude and longitude, you have unprojected coordinates. Anything you can do with these doesn’t require choosing a projection.
- Most consumer web maps use the Web Mercator projection, also known as the Google Web Map de facto standard, EPSG:900913 (“google” written with numbers), EPSG:3857, etc.
- Government agencies, desktop apps and other stuff often use the WGS84 projection, also known as EPSG:4326.
- It is technically straightforward to convert from unprojected coordinates to any projection, or between projections, using GIS packages or command line tools like GDAL. It can be slow to do this on the fly.
- Each projection is defined using a Spatial Reference System. An SRS can also define systems of unprojected coordinates, and even other planets.
- There are half a dozen common formats for describing the SRS, including:
- SRID, an identifier including the identifier scheme, like “EPSG:3857”, “ESRI:102113” or “SR-ORG:7483”.
- proj4, a short piece of text with lots of + and =, used by a tools like GDAL and TileMill. It looks like:
+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
- Well-known text (WKT), a verbose format that can also be used to define spatial data. For example:
- The tool you are working with (eg, TileMill) will only support certain projections. You need to:
- Find data that is in the right projection (Web Mercator is the safest), or convert it; and
- Tell the tool what projection it’s in, if it can’t guess. You will have to pick from a list, or use one of the formats above, that it supports.
Great summary, hope it might help out some beginners.
Oops, I messed up point 4. WGS84 is a datum, which means it’s a particular simplified model of the surface of the earth. EPSG:4326 means “interpret this latitude and longitude as points on the WGS84 datum”, which would be very slightly different from how you interpreted latitudes and longitudes defined on some other datum. Fortunately, WGS84 seems absolutely standard for everything.