# [OSM-dev] Earth radius

Sat Jun 18 11:20:27 UTC 2016

```Thanks, I used the authoritative sources and made the math myself.

I believe the OSM website at [2] should be fixed accordingly. The radius used in the sources [1, and elsewhere] is in fact as expected the WGS_84 sphere of radius 6378137.0. It means the radius (which is said to be 6372.7982 km, that’s about 40 km missing at the equator) and tile sizes at [2] should be fixed for others who want to do funny things and get mislead by these values.

I also believe the degree column should be removed from the table. Because the tiling scheme is a tile pyramid, where the tile sizes are cut in half for each subsequent level. That isn't the same as cutting the degree into half as shown in the table. For example, the length at zoom level 19 for 0.0005° at the equator is 0.21742088 using haversine - and not 0.29858214 which is the value you get cutting the extent into halfs.

So the page should be updated to (note the different sphere and m/ pixel values):
sphere: 6378137.0
The math for m / pixel is:
z0: (6378137 * 2 * pi) / 256
z1: (6378137 * 2 * pi) / 256 / 2
…
Level   Degree  Area    m / pixel       ~Scale
0       360     whole world     156543.033928   1:500 million
1       180             78271.516964    1:250 million
2       90              39135.758482    1:150 million
3       45              19567.879241    1:70 million
4       22.5            9783.9396205    1:35 million
5       11.25           4891.96981025   1:15 million
6       5.625           2445.98490513   1:10 million
7       2.813           1222.99245256   1:4 million
8       1.406           611.49622628    1:2 million
9       0.703   wide area       305.74811314    1:1 million
10      0.352           152.87405657    1:500,000
11      0.176   area    76.43702828     1:250,000
12      0.088           38.21851414     1:150,000
13      0.044   village or town         19.10925707     1:70,000
14      0.022           9.55462853      1:35,000
15      0.011           4.77731426      1:15,000
16      0.005   small road      2.38865713      1:8,000
17      0.003           1.19432856      1:4,000
18      0.001           0.59716428      1:2,000
19      0.0005          0.29858214      1:1,000

Ben

[1] https://github.com/openstreetmap/mod_tile/blob/6b9611aaf763f4f776d1fd363433aac7e25cb34b/src/gen_tile.cpp
[2] http://wiki.openstreetmap.org/wiki/Zoom_levels

Von: Komяpa <me at komzpa.net<mailto:me at komzpa.net>>
Datum: Samstag, 18. Juni 2016 um 07:38
An: Benjamin Stadin <benjamin.stadin at heidelberg-mobil.com<mailto:benjamin.stadin at heidelberg-mobil.com>>, OSM Dev List <dev at openstreetmap.org<mailto:dev at openstreetmap.org>>
Betreff: Re: [OSM-dev] Earth radius

Hi,

OSM uses EPSG:4326 for storing coordinates and EPSG:3857 for rendering.

You can get projection definitions on http://epsg.io/4326 and http://epsg.io/3857 respectively, or find it bundled with proj4 library that is widely used to deal with projection nuances.

сб, 18 июн. 2016 г. в 1:37, Stadin, Benjamin <Benjamin.Stadin at heidelberg-mobil.com<mailto:Benjamin.Stadin at heidelberg-mobil.com>>:
Hi,

I want to double check the earth radius used by OSM and zoom levels is
exactly 6372.7982 as said here:
http://wiki.openstreetmap.org/wiki/Zoom_levels.

I couldn¹t find this as constant in the sources yet. I¹m creating a new
storage system for vector tiles, independent of a projection.

Best
Ben

_______________________________________________
dev mailing list
dev at openstreetmap.org<mailto:dev at openstreetmap.org>
https://lists.openstreetmap.org/listinfo/dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20160618/c00a0856/attachment-0001.html>
```