Zoom levels

From OpenStreetMap Wiki
(Redirected from Height and width of a map)
Jump to navigation Jump to search
Variation with latitude of represented distances (in degrees or pixels) on the Mercator projection per actual distances (in meters) on Earth surface.
Distances per degree of longitude,
for the latitudes marked in the picture.
Difference of
longitudes
Actual distances
at 0° lat. at 30° lat. at 60° lat. at 87.5° lat.
0.010 00 ° ~ 1 000 m ~ 870.00 m ~ 500.0 m ~ 43.62 m
0.001 00 ° ~ 0 100 m ~ 087.00 m ~ 050.0 m ~ 04.36 m
0.000 10 ° ~ 0 010 m ~ 008.70 m ~ 005.0 m ~ 00.44 m
0.000 01 ° ~ 0 001 m ~ 000.87 m ~ 000.5 m ~ 00.04 m
Level # Tiles Tile width
(° of longitudes)
m / pixel
(on Equator)
~ Scale
(on screen)
Examples of
areas to represent
00 000 000 000 001 360.0000 156 543.000 1:500 million whole world
01 000 000 000 004 180.0000 078 272.000 1:250 million
02 000 000 000 016 090.0000 039 136.000 1:150 million subcontinental area
03 000 000 000 064 045.0000 019 568.000 1:70 million largest country
04 000 000 000 256 022.5000 009 784.000 1:35 million
05 000 000 001 024 011.2500 004 892.000 1:15 million large African country
06 000 000 004 096 005.6250 002 446.000 1:10 million large European country
07 000 000 016 384 002.8130 001 223.000 1:4 million small country, US state
08 000 000 065 536 001.4060 000 611.496 1:2 million
09 000 000 262 144 000.7030 000 305.748 1:1 million wide area, large metropolitan area
10 000 001 048 576 000.3520 000 152.874 1:500 thousand metropolitan area
11 000 004 194 304 000.1760 000 076.437 1:250 thousand city
12 000 016 777 216 000.0880 000 038.219 1:150 thousand town, or city district
13 000 067 108 864 000.0440 000 019.109 1:70 thousand village, or suburb
14 000 268 435 456 000.0220 000 009.555 1:35 thousand
15 001 073 741 824 000.0110 000 004.777 1:15 thousand small road
16 004 294 967 296 000.0050 000 002.389 1:8 thousand street
17 017 179 869 184 000.0030 000 001.194 1:4 thousand block, park, addresses
18 068 719 476 736 000.0010 000 000.597 1:2 thousand some buildings, trees
19 274 877 906 944 000.0005 000 000.299 1:1 thousand local highway and crossing details
20 1 099 511 627 776 000.00025 000 000.149 1:5 hundred A mid-sized building
  • The "# Tiles" column indicates the number of tiles needed to show the entire world at the given zoom level. This is useful when calculating storage requirements for pre-generated tiles.
  • The "° Tile width" column gives the map width in degrees of longitude, for a square tile drawn at that zoom level.
  • Values listed in the column "m / pixels" gives the number of meters per pixel at that zoom level for 256-pixel wide tiles. These values for "m / pixel" are calculated with an Earth radius of 6372.7982 km and hold at the Equator; for other latitudes the values must be multiplied by the cosine (approximately assuming a perfect spheric shape of the geoid) of the latitude.
  • "~ Scale" is only an approximate size comparison and refers to distances on the Equator. In addition, the given scales assume that 256-pixel wide tiles are rendered and will be dependent on the resolution of the viewing monitor: these values are for a monitor with a 0.3 mm / pixel (85.2 pixels per inch or PPI). Such scale is typically used for the kind of area to represent on a single tile (Note that when rendering on the web, the standard CSS pixel size is defined at 96 PPI, browsers will rescale the images when needed but only by integer factors on PNG images to avoid making the rendered text or icons too fuzzy; if the screen has a lower resolution, the rendered images may be larger; and it's possible for a renderer to create image with other resolutions than 256 pixels at 96 PPI to better fit the expected sizes, and for a web interface to automatically select other available resolutions for Hi-DPI screens, but this requires more storage and computing resources on the server; as well the zoom level in the formulas above do not necessarily need to be integers, and this may be used to get intermediate scales with tiles having more pixels).

Distance per pixel math

The horizontal distance represented by each square tile, measured along the parallel at a given latitude, is given by:

Stile = C ∙ cos(latitude) / 2 zoomlevel

where C means the equatorial circumference of the Earth (40 075 016.686 m ≈ 2π ∙ 6 378 137.000 m for the reference geoid used by OpenStreetMap).

As tiles are 256-pixels wide, the horizontal distance represented by one pixel is:

Spixel = Stile / 256 = C ∙ cos(latitude) / 2 (zoomlevel + 8)
For example on the equator and at zoom level 0, we get 40 075 016.686 / 256 ≈ 156 543.03 (in meters per pixel).

Make sure your calculator is in degrees mode, unless you want to express latitude in radians for some reason. C should be expressed in whatever scale unit you're interested in (miles, meters, feet, smoots, whatever).

This formula assumes that the Earth is perfectly spheric, but since the Earth is actually ellipsoidal there will be a slight error in this calculation, which does not take into account the flattening (with a slight reduction of radius for the best-fitting sphere passing at geographic poles at average sea level). But this error is very slight: it is null on the reference Equator, then grows to an absolute maximum of 0.3% at median latitudes, then shrinks back to zero at high latitudes towards poles.

The error also does not take into account additional differences caused by variation of the altitude on ground, or by the irregular variations of the geographic polar axis, and other errors caused by celestial tidal effects and climatic effects on the average sea level, or by continent drifts, major earthquakes, and magmatic flows below the crust).

Mapbox GL

Mapbox GL–based libraries uses 512×512-pixel tiles by default, so Mapbox GL zoom levels are one fewer than the zoom levels described above that are used by other tools.

See also