<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body>
    <p>Hi,</p>
    <p>Your method in QGIS is sound.  Area is calculated using the wgs84
      ellipsoid EPSG 7030. If you reproject to wgs84 zone 35N (I think
      this is close), area goes from 249566957499.7546m2  to
      249566957499.721m2 or a difference of 0.0336 m2.  I don't think
      densification would change things much.</p>
    <p>My question is the following: You know that QGIS uses the WGS84
      Ellipsoid.  What Ellipsoid are using used in the other
      software???  If you don't know, I would proceed until you figure
      that out.<br>
    </p>
    <p>This is the currently used ellipsoid in the proj database in QGIS
      3.16.  You can get this by typing proj -le in the OSFeo4W Shell.</p>
    <p><br>
          MERIT a=6378137.0      rf=298.257       MERIT 1983<br>
          SGS85 a=6378136.0      rf=298.257       Soviet Geodetic System
      85<br>
          GRS80 a=6378137.0      rf=298.257222101 GRS 1980(IUGG, 1980)<br>
          IAU76 a=6378140.0      rf=298.257       IAU 1976<br>
           airy a=6377563.396    rf=299.3249646   Airy 1830<br>
         APL4.9 a=6378137.0      rf=298.25        Appl. Physics. 1965<br>
          NWL9D a=6378145.0      rf=298.25        Naval Weapons Lab.,
      1965<br>
       mod_airy a=6377340.189    b=6356034.446    Modified Airy<br>
         andrae a=6377104.43     rf=300.0         Andrae 1876 (Den.,
      Iclnd.)<br>
         danish a=6377019.2563   rf=300.0         Andrae 1876 (Denmark,
      Iceland)<br>
        aust_SA a=6378160.0      rf=298.25        Australian Natl &
      S. Amer. 1969<br>
          GRS67 a=6378160.0      rf=298.2471674270 GRS 67(IUGG 1967)<br>
        GSK2011 a=6378136.5      rf=298.2564151   GSK-2011<br>
         bessel a=6377397.155    rf=299.1528128   Bessel 1841<br>
       bess_nam a=6377483.865    rf=299.1528128   Bessel 1841 (Namibia)<br>
         clrk66 a=6378206.4      b=6356583.8      Clarke 1866<br>
         clrk80 a=6378249.145    rf=293.4663      Clarke 1880 mod.<br>
      clrk80ign a=6378249.2      rf=293.4660212936269 Clarke 1880 (IGN).<br>
            CPM a=6375738.7      rf=334.29        Comm. des Poids et
      Mesures 1799<br>
         delmbr a=6376428.       rf=311.5         Delambre 1810
      (Belgium)<br>
        engelis a=6378136.05     rf=298.2566      Engelis 1985<br>
        evrst30 a=6377276.345    rf=300.8017      Everest 1830<br>
        evrst48 a=6377304.063    rf=300.8017      Everest 1948<br>
        evrst56 a=6377301.243    rf=300.8017      Everest 1956<br>
        evrst69 a=6377295.664    rf=300.8017      Everest 1969<br>
        evrstSS a=6377298.556    rf=300.8017      Everest (Sabah &
      Sarawak)<br>
        fschr60 a=6378166.       rf=298.3         Fischer (Mercury
      Datum) 1960<br>
       fschr60m a=6378155.       rf=298.3         Modified Fischer 1960<br>
        fschr68 a=6378150.       rf=298.3         Fischer 1968<br>
        helmert a=6378200.       rf=298.3         Helmert 1906<br>
          hough a=6378270.0      rf=297.          Hough<br>
           intl a=6378388.0      rf=297.          International 1909
      (Hayford)<br>
          krass a=6378245.0      rf=298.3         Krassovsky, 1942<br>
          kaula a=6378163.       rf=298.24        Kaula 1961<br>
          lerch a=6378139.       rf=298.257       Lerch 1979<br>
          mprts a=6397300.       rf=191.          Maupertius 1738<br>
       new_intl a=6378157.5      b=6356772.2      New International 1967<br>
        plessis a=6376523.       b=6355863.       Plessis 1817 (France)<br>
           PZ90 a=6378136.0      rf=298.25784     PZ-90<br>
         SEasia a=6378155.0      b=6356773.3205   Southeast Asia<br>
        walbeck a=6376896.0      b=6355834.8467   Walbeck<br>
          WGS60 a=6378165.0      rf=298.3         WGS 60<br>
          WGS66 a=6378145.0      rf=298.25        WGS 66<br>
          WGS72 a=6378135.0      rf=298.26        WGS 72<br>
          WGS84 a=6378137.0      rf=298.257223563 WGS 84<br>
         sphere a=6370997.0      b=6370997.0      Normal Sphere
      (r=6370997)<br>
    </p>
    <p>Nicolas<br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 2021-01-05 11:43 a.m., Rahkonen
      Jukka (MML) wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:2c93e9b0d32244d4822bd0a83805b8ae@maanmittauslaitos.fi">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}span.Shkpostityyli17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}div.WordSection1
        {page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><span lang="EN-US">I wonder what method
            QGIS is using when it computes ellipsoidal area with $area
            function. I made a test with this EPSG:4326 polygon:<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">POLYGON (( 20.13293641
            59.95688345, 26.94617837 60.47397663, 29.74782155
            62.56499443, 27.45254202 68.7065034, 23.75771765
            68.24937206, 25.42698984 65.27444593, 21.51545237
            63.10353609, 21.4056276 61.12318104, 19.41123592
            60.40477513, 20.13293641 59.95688345 ))<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">I checked that the CRS
            of the project and layer were both EPSG:4326. The ellipsoid
            in the Project-Settings was WGS 84 (EPSG:7030). The area
            that $area returns is<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">249566957499.7546<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">As a references I used
            PostGIS and web site
            <a
              href="https://geographiclib.sourceforge.io/scripts/geod-calc.html#area"
              moz-do-not-send="true">https://geographiclib.sourceforge.io/scripts/geod-calc.html#area</a>.
            With my test polygon they both give this result:<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">251199344354.4308<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">PostGIS returns bigger
            area. The difference is 0.654% so not huge but not
            negligible either.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">A third test with
            SpatiaLite 5.0 gives a result that is very close to PostGIS
            (difference 0.001%).<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">251195856999.549927<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">As a conclusion I have
            decided to trust in PostGIS because it gives the same
            results than the web site
            <a
              href="https://geographiclib.sourceforge.io/scripts/geod-calc.html"
              moz-do-not-send="true">https://geographiclib.sourceforge.io/scripts/geod-calc.html</a>
            that feels scientifically sound. However, I wonder if I have
            used QGIS in a correct way or if there is anything I could
            do for getting areas to match better with PostGIS for
            example by densifying the long segments in my test polygon.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">For getting testing easy
            I attach directly runnable  SQL for PostGIS and Spatialite
            (version 5.0 with RTTopo is needed) as well as a coordinate
            list for the web app.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">PostGIS<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">select
            st_area(st_geogfromtext('POLYGON ((<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">20.13293641  
            59.95688345,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">26.94617837  
            60.47397663,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">29.74782155  
            62.56499443,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">27.45254202  
            68.70650340,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">23.75771765  
            68.24937206,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">25.42698984  
            65.27444593,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">21.51545237  
            63.10353609,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">21.40562760  
            61.12318104,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">19.41123592  
            60.40477513,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">20.13293641  
            59.95688345))') , true);<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Spatialite<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">select
            st_area(st_geomfromtext('POLYGON ((<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">20.13293641  
            59.95688345,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">26.94617837  
            60.47397663,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">29.74782155  
            62.56499443,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">27.45254202  
            68.70650340,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">23.75771765  
            68.24937206,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">25.42698984  
            65.27444593,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">21.51545237  
            63.10353609,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">21.40562760  
            61.12318104,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">19.41123592  
            60.40477513,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">20.13293641  
            59.95688345))') ,true);<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Web site (notice lat-lon
            order)<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">59.95688345 20.13293641
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">60.47397663 26.94617837
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">62.56499443 29.74782155
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">68.70650340 27.45254202
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">68.24937206 23.75771765
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">65.27444593 25.42698984
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">63.10353609 21.51545237
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">61.12318104 21.40562760
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">60.40477513 19.41123592
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">59.95688345 20.13293641<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">-Jukka Rahkonen- <o:p></o:p></span></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Nicolas Cadieux
<a class="moz-txt-link-freetext" href="https://gitlab.com/njacadieux">https://gitlab.com/njacadieux</a></pre>
  </body>
</html>