ARTLEBEDEV
  • Graphic design
  • Studio projects
  • OK, Google! Add the minor radius

    As we know, Web Mercator developers made life easier for everybody by throwing away the minor radius. It’s only logical, since it doesn’t really matter what size or shape the object is as its coordinates on the map are given in degrees. Thanks to this, the same geographical coordinates can be applied to vastly different objects.

    In the World Geodetic System WGS 84 our sphere, or, more precisely, the reference ellipsoid, has inverse flattening of 298,257 223 563 which means that the major radius is 6 378 137 meters and the minor radius is 6 356 752,314 245 18 meters. This means that on the Web Mercator map all coordinates are where they should be, but the sphere should be flattened by 42,769 371 509 641 1 km.

    Let’s compare the reference ellipsoid with a sphere.

    Visually, the difference isn’t noticeable, but if the area of a sphere can be calculated simply with 4πR2 = 511 207 893,395 811, the area of an oblate spheroid (a > b) is much more complex:

    Ideally, we need to break the ellipsoid down into segments similarly to the sphere, but using integrals to calculate areas of the segments of revolution between the parallels.

    To avoid having to call a mathematical analysis expert, using a creative solution: drawing the ellipse in AutoCAD and calculating the areas of surfaces of revolution from one parallel to the next. We already know parallel coordinates from the previous part and as we know they will always remain the same, even if the Earth becomes cubic.

    This approach is very visual but still, AutoCAD returns a slightly different area of the ellipsoid — 510 065 621,655 637 km2. The ellipsoid surface formula given above tells us that AutoCAD is 0,0‪68 451 04 km2 short.

    Let’s try to find the missing meters.

    There is a segment of the ellipse between the arc vertices t1 and t2 that creates a surface of revolution whose area we will examine closer.

    Let’s use Mathcad for calculations.

    Major radius (a) = 6 378,137 km
    Inverse flattening = 298,257 223 563
    Minor radius (b) = aa / Inverse flattening = 6 356,752 414 245 179 km

    Parametric equation of ellipse x = a cos(t), y = b sin(t).

    For example, to measure the perimeter of the ellipse, we can integrate sqrt(x'2 + y'2) = sqrt((a sin(t))2 + (b cos(t))2).

    Let’s compare it with the result produced by Ramanujan’s formula for ellipse perimeter.

    π (3 (a + b) – sqrt((3 a + b) (a + 3 b)) = 40 007,862 917 250 88

    For an ellipse of the same eccentricity as the Earth Meridian, such a relative error is only about 4,38×10-20. For an ellipse the size of the Earth’s meridian, this would mean a ludicrous precision of 1.75 pm (pm = picometer), or about one sixtieth of the conventional diameter of an hydrogen atom (which is twice the Bohr radius)!

    Gérard P. Michon Perimeter of an Ellipse, 2000

    Similarly, we can integrate a cos(t) sqrt((a sin(t))2 + (b cos(t))2), to find the area of an ellipsoid.

    In the same manner we can calculate the area of the polar segment from t1 to the polar vertex t2.

    In this case, t1 = atan(a / b · tan(θ)), t2 = ½ π.

    Polar parallel angle = 85,051 128 78° · π / 180 = 1,484 422 229 748 708 rad
    t1 = atan(a / b · tan(Polar parallel angle)) = 1,484 710 394 721 241 4 rad

    Dividing the gradient scale from the equator to the polar parallel into 256 segments.

    Sub = Polar parallel / 256 = 0,012 271 846 303 24

    Using the Sub module to calculate the area of ellipsoid segments from the equator to the polar parallel.

    i — counter; y — line number; θ — parallel angle; t1 — angle of the radius vector of the arc vertex; S — area of a segment, km2.

    Just 7 lines of code.

    Comparing territory areas on the sphere and the ellipsoid in square kilometers.

    Rating Territory Web Mercator sphere   Reference ellipsoid WGS 84 Difference Difference, %
    1Russia16 523 293>16 440 626 82 6670,500
    2Antarctica12 982 769>12 901 200 81 5690,628
    3China9 279 960>9 258 246 21 7140,234
    4Canada8 951 513>8 908 366 43 1470,482
    5Brazil8 402 706>8 399 858 2 8480,034
    6United States of&nbps;America7 675 122>7 654 643 20 4790,267
    7Australia7 602 329>7 592 594 9 7350,128
    8India3 107 011>3 103 770 3 2410,104
    9Argentina2 718 051>2 712 060 5 9910,220
    10Kazakhstan2 663 315>2 653 464 9 8510,370
    11Algeria2 311 284>2 307 828 3 4560,150
    12Democratic Republic of the Congo2 298 093>2 297 964 1290,006
    13Greenland (Denmark)2 148 362>2 135 337 13 0250,606
    14Mexico1 945 932>1 943 749 2 1830,112
    15Saudi Arabia1 933 260>1 931 076 2 1840,113
    16Indonesia1 884 107>1 884 046 610,003
    17Sudan1 848 010>1 847 033 9770,053
    18Libya1 619 483>1 617 231 2 2520,139
    19Iran1 614 889>1 611 758 3 1310,194
    20Mongolia1 544 445>1 538 959 5 4860,355
    21State of Alaska (USA)1 445 171>1 437 415 7 7560,537
    22Peru1 283 667>1 283 402 2650,021
    23Chad1 261 656>1 261 030 6260,050
    24Mali1 253 642>1 252 873 7690,061
    25Angola1 253 229>1 252 826 4030,032
    26South Africa1 207 747>1 205 842 1 9050,158
    27Niger1 181 112>1 180 389 7230,061
    28Colombia1 126 802>1 126 743 590,005
    29Ethiopia1 125 202>1 125 017 1850,016
    30Bolivia1 076 932>1 076 320 6120,057
    31Mauritania1 041 661>1 040 813 8480,081
    32Egypt 995 966> 994 631 1 3350,134
    33Venezuela 904 531> 904 426 1050,012
    34Nigeria 904 112> 903 935 1770,020
    35Tanzania 886 158> 886 072 860,010
    36Pakistan 846 859> 845 440 1 4190,168
    37Namibia 819 591> 818 802 7890,096
    Show all
    38Mozambique 777 243> 776 766 4770,061
    39Turkey 766 879> 764 837 2 0420,266
    40Chile 743 189> 741 401 1 7880,241
    41Zambia 740 579> 740 302 2770,037
    42Myanmar 663 594> 663 006 5880,089
    43South Sudan 645 839> 645 764 750,012
    44Afghanistan 638 342> 637 016 1 3260,208
    45Somalia 637 081> 637 018 630,010
    46Central African Republic 623 043> 622 985 580,009
    47Madagascar 590 710> 590 266 4440,075
    48Kenya 577 330> 577 324 60,001
    49Botswana 561 420> 560 877 5430,097
    50Ukraine 558 031> 555 891 2 1400,383
    51France 545 040> 543 119 1 9210,353
    52Thailand 510 625> 510 383 2420,047
    53Spain 495 397> 494 005 1 3920,281
    54Cameroon 464 083> 464 047 360,008
    55Turkmenistan 463 674> 462 439 1 2350,266
    56Papua New Guinea 461 724> 461 681 430,009
    57Yemen 454 707> 454 476 2310,051
    58Uzbekistan 435 604> 434 311 1 2930,297
    59Iraq 429 297> 428 441 8560,199
    60Morocco 412 458> 411 687 7710,187
    61Sweden 412 314> 410 151 2 1630,525
    62Paraguay 397 335> 396 919 4160,105
    63Zimbabwe 388 113> 387 835 2780,072
    64Japan 368 605> 367 693 9120,248
    65Germany 352 555> 351 127 1 4280,405
    66Republic of the Congo 342 139> 342 134 50,001
    67Vietnam 324 000> 323 811 1890,058
    68Cote d'Ivoire 320 564> 320 525 390,012
    69Oman 309 362> 309 104 2580,084
    70Poland 307 097> 305 817 1 2800,417
    71Norway 305 211> 303 569 1 6420,538
    72Finland 302 498> 300 856 1 6420,543
    73Italy 297 320> 296 404 9160,308
    74Philippines 293 519> 293 431 880,030
    75Burkina Faso 273 799> 273 715 840,031
    76Western Sahara 270 371> 270 055 3160,117
    77New Zealand 264 276> 263 493 7830,296
    78Gabon 261 946> 261 945 10,000
    79Ecuador 247 882> 247 880 20,001
    80Guinea 245 958> 245 903 550,022
    81United Kingdom (UK) 241 571> 240 512 1 0590,438
    82Romania 234 966> 234 155 8110,345
    83Ghana 233 184> 233 153 310,014
    84Laos 228 584> 228 428 1560,068
    85Guyana 210 929> 210 918 110,005
    86Belarus 204 905> 204 018 8870,433
    87Uganda 204 166> 204 164 20,001
    88East Malaysia 197 022> 197 016 60,003
    89Senegal 196 113> 196 032 810,041
    90Kyrgyzstan 190 095> 189 537 5580,294
    91Syria 185 250> 184 841 4090,221
    92Cambodia 177 905> 177 847 580,033
    93Uruguay 174 208> 173 865 3430,197
    94Tunisia 148 430> 148 117 3130,211
    95Nepal 147 126> 146 905 2210,151
    96Suriname 144 772> 144 767 50,004
    97Tajikistan 139 171> 138 809 3620,260
    98Bangladesh 134 038> 133 891 1470,110
    99West Malaysia 130 553> 130 548 50,004
    100Greece 130 398> 130 051 3470,266
    101Eritrea 121 106> 121 049 570,047
    102North Korea 120 588> 120 252 3360,279
    103Nicaragua 119 227> 119 187 400,034
    104Benin 115 716> 115 693 230,019
    105Honduras 111 724> 111 675 490,044
    106Cuba 110 261> 110 160 1010,091
    107Bulgaria 110 122> 109 781 3410,309
    108Guatemala 108 315> 108 262 530,049
    109Iceland 100 555> 100 002 5530,550
    110South Korea 99 147> 98 913 2340,236
    111Liberia 96 081> 96 073 80,009
    112Malawi 94 115> 94 080 350,037
    113Hungary 91 506> 91 176 3300,360
    114Jordan 89 086> 88 925 1610,181
    115Portugal 87 941> 87 700 2410,273
    116Azerbaijan 84 423> 84 186 2370,280
    117French Guiana (France) 83 680> 83 677 30,003
    118Austria 83 118> 82 815 3030,365
    119Czech Republic 78 219> 77 914 3050,390
    120Serbia 76 724> 76 474 2500,326
    121Panama 74 528> 74 517 110,015
    122Sierra Leone 72 229> 72 218 110,015
    123United Arab Emirates 71 477> 71 398 790,110
    124Ireland 68 490> 68 196 2940,429
    125Sri Lanka 64 708> 64 701 70,012
    126Lithuania 63 577> 63 289 2880,453
    127Latvia 63 207> 62 910 2970,470
    128Svalbard and Jan Mayen (Norway) 61 745> 61 347 3980,644
    129Georgia 56 782> 56 611 1710,300
    130Togo 56 600> 56 592 80,015
    131Croatia 55 814> 55 626 1880,336
    132Costa Rica 51 138> 51 128 100,020
    133Bosnia and Herzegovina 50 916> 50 750 1660,325
    134Slovakia 48 622> 48 438 1840,378
    135Dominican Republic 47 802> 47 768 340,070
    136Estonia 43 107> 42 896 2110,489
    137Denmark 42 384> 42 189 1950,460
    138Bhutan 39 996> 39 939 570,142
    139Switzerland 39 778> 39 636 1420,356
    140Taiwan 35 560> 35 521 390,109
    141Netherlands 34 130> 33 987 1430,419
    142Guinea-Bissau 33 431> 33 422 90,029
    143Lesotho 30 598> 30 548 500,164
    144Belgium 30 411> 30 289 1220,401
    145Moldova 30 244> 30 135 1090,361
    146Armenia 28 394> 28 315 790,280
    147Solomon Islands 28 307> 28 303 40,016
    148Albania 28 027> 27 946 810,290
    149Equatorial Guinea 26 968= 26 968 0,001
    150Haiti 26 829> 26 810 190,071
    151Burundi 25 043= 25 043 0,002
    152Republic of Macedonia 24 891> 24 818 730,296
    153Rwanda 23 922= 23 922 0,001
    154Belize 21 820> 21 807 130,059
    155Israel 21 562> 21 522 400,182
    156Djibouti 21 520> 21 514 60,028
    157El Salvador 20 406> 20 399 70,038
    158Slovenia 20 184> 20 114 700,348
    159Fiji 18 734> 18 723 110,060
    160New Caledonia (France) 18 532> 18 516 160,089
    161Kuwait 17 380> 17 352 280,161
    162Swaziland 17 349> 17 326 230,134
    163Hawaii (USA) 16 680> 16 667 130,081
    164East Timor 14 698> 14 696 20,016
    165Montenegro 13 596> 13 554 420,309
    166Kaliningrad Oblast (Russia) 13 326> 13 267 590,446
    167Bahamas 12 286> 12 272 140,113
    168Vanuatu 12 083> 12 076 70,053
    169Falkland Islands (UK) 11 834> 11 785 490,413
    170Qatar 11 606> 11 591 150,123
    171Jamaica 10 978> 10 971 70,065
    172Republic of Kosovo 10 880> 10 846 340,307
    173Gambia 10 450> 10 446 40,037
    174Lebanon 10 239> 10 217 220,209
    175Puerto Rico (USA) 8 886> 8 881 50,066
    176Abkhazia 8 665> 8 638 270,313
    177Galapagos Islands (Ecuador) 8 019= 8 019 0,000
    178Canary Islands (Spain) 7 414> 7 403 110,151
    179Kerguelen Islands (France) 7 005> 6 978 270,385
    180Palestine 6 036> 6 025 110,188
    181Brunei Darussalam 5 863= 5 863 0,004
    182Republic of Cyprus 5 511> 5 499 120,220
    183Trinidad and Tobago 5 137> 5 135 20,022
    184Cape Verde 4 031> 4 028 30,051
    185South Ossetia 3 860> 3 848 120,304
    186South Georgia and the South Sandwich Islands (UK) 3 644> 3 628 160,446
    187French Polynesia (France) 3 518> 3 516 20,051
    188Northern Cyprus 3 461> 3 453 80,223
    189Transnistria 3 209> 3 198 110,363
    190Samoa 2 835> 2 834 10,038
    191Luxembourg 2 586> 2 576 100,391
    192Reunion (France) 2 499> 2 497 20,087
    193Azores (Portugal) 2 293> 2 287 60,259
    194Mauritius 1 991> 1 990 10,080
    195Comoros 1 657= 1 657 0,028
    196Guadeloupe (France) 1 626> 1 625 10,053
    197Faroe Islands (Denmark) 1 378> 1 370 80,523
    198Martinique (France) 1 111> 1 110 10,043
    199Hong Kong 1 067> 1 066 10,096
    200Sao Tome and Principe 998= 998 0,000
    201Turks and Caicos Islands (UK) 886> 885 10,091
    202Madeira (Portugal) 790> 789 10,197
    203Bahrain 758> 757 10,130
    204Dominica 748= 748 0,048
    205Singapore 678= 678 0,000
    206Tonga 659= 659 0,078
    207Federated States of Micronesia 655> 654 10,010
    208Saint Lucia 603= 603 0,039
    209Isle of Man (UK) 568> 566 20,442
    210Guam (USA) 539= 539 0,037
    211Line Islands (Kiribati) 489= 489 0,001
    212Andorra 465> 464 10,307
    213Northern Mariana Islands (USA) 462= 462 0,051
    214Palau 442= 442 0,011
    215Seychelles 440= 440 0,010
    216Barbados 434= 434 0,034
    217Antigua and Barbuda 422> 421 10,059
    218Curacao (Netherlands) 419> 418 10,030
    219Saint Vincent and the Grenadines 382= 382 0,035
    220Mayotte (France) 382= 382 0,033
    221Grenada 352= 352 0,030
    222Heard Island and McDonald Islands (Australia) 345> 344 10,429
    223Crozet Islands (France) 339> 338 10,350
    224US Virgin Islands (USA) 336> 335 10,063
    225Prince Edward Islands (South Africa ) 330> 329 10,356
    226Malta 309> 308 10,230
    227Gilbert Islands (Kiribati) 284= 284 0,000
    228Cook Islands (New Zealand) 284= 284 0,070
    229Bonaire (Netherlands) 269> 268 10,030
    230Niue (New Zealand) 261= 261 0,071
    231Cayman Islands (UK) 259> 258 10,074
    232Saint Kitts and Nevis 258= 258 0,060
    233Akrotiri and Dhekelia (UK) 248= 248 0,220
    234Saint Pierre and Miquelon (France) 218> 217 10,358
    235Marshall Islands 210= 210 0,016
    236American Samoa (USA) 197= 197 0,041
    237Easter Island (Chile) 183> 182 10,142
    238Tristan da Cunha (UK) 176= 176 0,256
    239Aruba (Netherlands) 175= 175 0,031
    240Liechtenstein 158> 157 10,362
    241British Virgin Islands (UK) 139= 139 0,068
    242Wallis and Futuna (France) 139= 139 0,039
    243Christmas Island (Australia) 133= 133 0,022
    244Saint Helena (UK) 122= 122 0,051
    245Macquarie Island (Australia) 122> 121 10,446
    246Jersey (UK) 120> 119 10,384
    247Montserrat (UK) 100= 100 0,057
    248Ascension Island (UK) 96= 96 0,013
    249Maldives 87= 87 0,004
    250Guernsey (UK) 78> 77 10,389
    251Anguilla (UK) 77= 77 0,066
    252Bouvet Island (Norway) 73= 73 0,443
    253San Marino 61= 61 0,322
    254Amsterdam Island (France) 54> 53 10,254
    255Bermuda (UK) 50= 50 0,191
    256Pitcairn Islands (UK) 49= 49 0,114
    257Saint Martin (French) 46= 46 0,066
    258San Andres, Providencia and Santa Catalina (Colombia) 46= 46 0,034
    259British Indian Ocean Territory (UK) 45= 45 0,010
    260Tokelau (New Zealand) 41= 41 0,018
    261Norfolk Island (Australia) 36= 36 0,160
    262Phoenix Islands (Kiribati) 33= 33 0,003
    263Sint Maarten (Netherlands) 31= 31 0,066
    264Macau 30= 30 0,096
    265Nauru 21= 21 0,000
    266Europa Island (France) 21= 21 0,096
    267Sint Eustatius (Netherlands) 20= 20 0,062
    268Ceuta (Spain) 20= 20 0,229
    269Tuvalu 20= 20 0,009
    270Saint Barthelemy (France) 18= 18 0,062
    271Saba (Netherlands) 12= 12 0,062
    272Cocos Islands (Australia) 12= 12 0,030
    273Melilla (Spain) 12= 12 0,223
    274Saint-Paul Island (France) 10= 10 0,260
    275Wake Island (USA) 9= 9 0,071
    276Gibraltar (UK) 6= 6 0,235
    277Spratly Islands (Brunei, China, Malaysia, Philippines, Taiwan and Vietnam) 6= 6 0,019
    278Banaba Island (Kiribati) 6= 6 0,000
    279Midway Atoll (USA) 5= 5 0,148
    280Juan de Nova Island (France) 5= 5 0,057
    281Jarvis Island (USA) 4= 4 0,000
    282Paracel Islands (China, Taiwan, Vietnan) 4= 4 0,053
    285Glorioso Islands (France) 4= 4 0,027
    283Navassa Island (USA) 4= 4 0,066
    284Clipperton Island (France) 3= 3 0,021
    286Palmyra Atoll (USA) 3= 3 0,007
    287Monaco 2= 2 0,322
    288Howland Island (USA) 2= 2 0,000
    289Baker Island (USA) 1= 1 0,000
    290Johnston Atoll (USA) 1= 1 0,057
    291Tromelin Island (France) 1= 1 0,049
    292Kure Atoll (USA)0,9=0,9 0,154
    293Vatican City0,5=0,5 0,298
    294Kingman Reef (USA)0,002=0,002  
    295Sealand0,001=0,001  
           
     Water366 495 583>365 729 482 766 1020,209
     Land144 712 310>144 336 140 376 1700,260
     Total511 207 893>510 065 6221 142 2720,223

    The territory rating remained mostly the same, yet Somali, Uganda and Tuvalu moved up a place. If we look at the numbers carefully, we can see that the inverse flattening decreases territory areas gradually, the closer they are to the pole. The ellipsoid flattens the sphere unflattens the are area of the polarmost line by 0,664 411 282 512 56%.. For smaller territories (up to 1000 km2) the difference is negligible, but it becomes quite considerable for larger territories.

    Ultimately, if we compare the area of Yemen that the housewife was able to calculate, 454 716 km2 with its area on the sphere, 454 707 km2 and on the ellipsoid, 454 476 km2, we could say that by using the Web Mercator service for area calculation, the housewife measured the area of Yemen on a sphere. It turns out that all modern housewives actually measure everything on a sphere, but before you start pointing fingers at the geodetic services using Web Mercator, just ask any globe salesman if any of their globes have inverse flattening.

    Part V