<div dir="ltr"><div dir="ltr"><div>Kristian,</div><div><br></div><div>Thanks for those calculations. Before this discussion I was contemplating doing a line and polygon measurement tool for Shape Tools by clicking on an existing shape and using geographiclib calculate the measurements, but if it is possible to replace the existing QGIS measuring functions and Vincinty with geographiclib, then I will hold off. Shape Tools uses geographiclib for all its calculations and I am pleased with it. In the last release I included a function to measure all geometry on a layer.</div><div><br></div><div>I don't know who has the most accurate algorithm. I just checked Google Earth and it measures your polygon at 14,672 km^2. I'm guessing Google Earth is not as accurate as some of those other applications. As far as I know geographiclib has the most accurate ellipsoid calculations. The only thing better would be to include elevation. I'm not an expert in this area, but would the gravity models provide more accuracy?</div><div><br></div><div><a href="https://geographiclib.sourceforge.io/html/gravity.html#gravityinst">https://geographiclib.sourceforge.io/html/gravity.html#gravityinst</a></div><div><br></div><div>Calvin</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 25, 2018 at 9:31 AM, Kristian Evers <span dir="ltr"><<a href="mailto:kreve@sdfe.dk" target="_blank">kreve@sdfe.dk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Right, here are the calculated areas as returned by a number of different GIS applications and the planimeter app of GeographicLib for reference:<br>
<br>
Caris LOTS: 14.737 km^2<br>
ArcMap:     14.727,446 km^2<br>
MapInfo:    14.727,352 km^2<br>
GeoMedia:   14.726,443 km^2<br>
Planimeter: 14.722,522 km^2<br>
QGIS 3.2:   14.652,181 km^2<br>
QGIS 2.8:   14.652,181 km^2<br>
<br>
The polygon that I have used to get the numbers above can be found here: <a href="https://gist.github.com/kbevers/207b5bcb9be20e7554abe5f56742ec2c" rel="noreferrer" target="_blank">https://gist.github.com/<wbr>kbevers/<wbr>207b5bcb9be20e7554abe5f56742ec<wbr>2c</a><br>
<br>
I am quite confident that GeographicLib delivers the most accurate result (if you have doubts, this reference [0] should convince you). As can be seen from the table above all but QGIS come fairly close. I expect some variation in the results as these are numerical approximations, although I think QGIS is too far of the mark. My suspicion is that the geodesic algorithm used by QGIS (and apparently GRASS) is to blame here.<br>
<br>
/Kristian<br>
<br>
[0] <a href="https://arxiv.org/pdf/1102.1215.pdf" rel="noreferrer" target="_blank">https://arxiv.org/pdf/1102.<wbr>1215.pdf</a> <br>
<br>
-----Oprindelig meddelelse-----<br>
Fra: QGIS-Developer <<a href="mailto:qgis-developer-bounces@lists.osgeo.org">qgis-developer-bounces@lists.<wbr>osgeo.org</a>> På vegne af Kristian Evers<br>
Sendt: 25. september 2018 09:15<br>
Til: Nyall Dawson <<a href="mailto:nyall.dawson@gmail.com">nyall.dawson@gmail.com</a>><br>
Cc: qgis-developer <<a href="mailto:qgis-developer@lists.osgeo.org">qgis-developer@lists.osgeo.<wbr>org</a>><br>
<div class="HOEnZb"><div class="h5">Emne: Re: [QGIS-Developer] [Qgis-user] New Features in Shape Tools 3.2.0<br>
<br>
It's not a small area, that's why I have been nitpicking ellipsoid area calculation<br>
algorithms!<br>
I did end up doing the calculations with geographiblib to get a reference to judge<br>
various other calculations by. It's a pain in the butt to extract the data from a<br>
polygon shapefile (or whatever) and format it to suit the planimeter app of<br>
geographiclib. It would be so much cooler if I could get the same results by<br>
clicking info on a polygon in QGIS :-)<br>
<br>
/Kristian<br>
<br>
<br>
-----Oprindelig meddelelse-----<br>
Fra: Nyall Dawson <<a href="mailto:nyall.dawson@gmail.com">nyall.dawson@gmail.com</a>> <br>
Sendt: 25. september 2018 09:07<br>
Til: Kristian Evers <<a href="mailto:kreve@sdfe.dk">kreve@sdfe.dk</a>><br>
Cc: Paolo Cavallini <<a href="mailto:cavallini@faunalia.it">cavallini@faunalia.it</a>>; qgis-developer <<a href="mailto:qgis-developer@lists.osgeo.org">qgis-developer@lists.osgeo.<wbr>org</a>><br>
Emne: Re: [QGIS-Developer] [Qgis-user] New Features in Shape Tools 3.2.0<br>
<br>
On Tue, 25 Sep 2018 at 16:59, Kristian Evers <<a href="mailto:kreve@sdfe.dk">kreve@sdfe.dk</a>> wrote:<br>
><br>
> Hi Paolo,<br>
><br>
> I have some rought notes that I can try to polish up a bit and share here.<br>
> I'll see if I can find the time for that today. I didn't get to the bottom of<br>
> the problem but I am leaning towards the issue being that QGIS uses an<br>
> inferior algorithm to determine geodesics. Unfortunately I couldn't find out<br>
> from either the source code or the documentation which algorithm is used.<br>
> As far as I remember it differs from the otherwise popular algorithm by<br>
> Vincenty. That may be because a different algorithm is used or the<br>
> Implementation is wrong.<br>
><br>
> I'll get back with a better write-up later and some test data and results.<br>
<br>
We use a direct port from GRASS:<br>
<br>
<a href="https://github.com/qgis/QGIS/blob/master/src/core/qgsdistancearea.cpp#L690" rel="noreferrer" target="_blank">https://github.com/qgis/QGIS/<wbr>blob/master/src/core/<wbr>qgsdistancearea.cpp#L690</a><br>
<br>
vs GRASS upstream:<br>
<br>
<a href="https://trac.osgeo.org/grass/browser/grass/trunk/lib/gis/area_poly1.c?rev=71260" rel="noreferrer" target="_blank">https://trac.osgeo.org/grass/<wbr>browser/grass/trunk/lib/gis/<wbr>area_poly1.c?rev=71260</a><br>
<br>
It's not very stable for very small areas -- better to use cartesian<br>
calculations there. Or bring in geographiclib and punt the<br>
responsibility elsewhere ;)<br>
<br>
Nyall<br>
<br>
<br>
<br>
><br>
> /Kristian<br>
><br>
> -----Oprindelig meddelelse-----<br>
> Fra: QGIS-Developer <<a href="mailto:qgis-developer-bounces@lists.osgeo.org">qgis-developer-bounces@lists.<wbr>osgeo.org</a>> På vegne af Paolo Cavallini<br>
> Sendt: 25. september 2018 08:23<br>
> Til: <a href="mailto:qgis-developer@lists.osgeo.org">qgis-developer@lists.osgeo.org</a><br>
> Emne: Re: [QGIS-Developer] [Qgis-user] New Features in Shape Tools 3.2.0<br>
><br>
> Hi Kristian,<br>
><br>
><br>
> Il 09/25/2018 07:24 AM, Kristian Evers ha scritto:<br>
> ><br>
> ><br>
> > On a related note, I have been meaning to raise a similar issue based<br>
> > on QGIS’s not so accurate polygon-area-on-the-ellipsoid calculations.<br>
> > A colleague of mine came across some differences between QGIS and<br>
> > CARIS LOTS while doing area calculations in relation to a border<br>
> > dispute at sea. After that I tested several popular closed source GIS<br>
> > apps and they all performed better than QGIS.<br>
> this is worth exploring in detail. could you please be more specific? do<br>
> you have a test case? could you share the results, or give us a way to<br>
> replicate them?<br>
> Thanks.<br>
><br>
> --<br>
> Paolo Cavallini - <a href="http://www.faunalia.eu" rel="noreferrer" target="_blank">www.faunalia.eu</a><br>
> <a href="http://QGIS.ORG" rel="noreferrer" target="_blank">QGIS.ORG</a> Chair:<br>
> <a href="http://planet.qgis.org/planet/user/28/tag/qgis%20board/" rel="noreferrer" target="_blank">http://planet.qgis.org/planet/<wbr>user/28/tag/qgis%20board/</a><br>
><br>
> ______________________________<wbr>_________________<br>
> QGIS-Developer mailing list<br>
> <a href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a><br>
> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
> ______________________________<wbr>_________________<br>
> QGIS-Developer mailing list<br>
> <a href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a><br>
> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
______________________________<wbr>_________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
______________________________<wbr>_________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a></div></div></blockquote></div><br></div>