<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.im
        {mso-style-name:im;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:3.0cm 2.0cm 3.0cm 2.0cm;}
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]-->
</head>
<body lang="DA" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">I am not super familiar with QGIS’ interface to PROJ but I don’t think there’s a way to do that at the moment. The new
 PROJ API exposes a function that computes the geodesic distance between two points directly:
<a href="https://proj4.org/development/reference/functions.html#c.proj_lp_dist">https://proj4.org/development/reference/functions.html#c.proj_lp_dist</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">This would be a good idea to expose once QGIS incorporates the new PROJ API. The calculations are super fast and Charles
 Karney, the developer of GeograhpicLib, says that they are accurate to micrometer level.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">/Kristian<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">PS. The proj_factors function is also a good candidate for inclusion in the QGIS Python API since it gives direct access
 to various cartographic properties of a projection: <a href="https://proj4.org/development/reference/functions.html#c.proj_factors">
https://proj4.org/development/reference/functions.html#c.proj_factors</a> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Fra:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> QGIS-Developer [mailto:qgis-developer-bounces@lists.osgeo.org]
<b>På vegne af </b>C Hamilton<br>
<b>Sendt:</b> 4. maj 2018 15:22<br>
<b>Til:</b> Paolo Cavallini <cavallini@faunalia.it><br>
<b>Cc:</b> qgis-developer <qgis-developer@lists.osgeo.org><br>
<b>Emne:</b> Re: [QGIS-Developer] Length measurement weirdness (again)<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">This is one of the reasons why I wrote Geodesic Measure tool that is part of Shape Tools. It is based on geographiclib's distance measures and is relative accurate. I never knew whether I had the default QGIS measure tool set correctly
 or not to give accurate measurements. More accurate measurements could be obtained using geographiclib's gravity models such as EGM2008, but that would require shipping the associated data which is large.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">By the way I found out that the latest versions of proj.4 integrated geographiclib. Is there a way to call these routines from a python plugin in QGIS. I would assume the C code would be faster than the python library which is what I use.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">All the best.<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Fri, May 4, 2018 at 3:07 AM, Paolo Cavallini <<a href="mailto:cavallini@faunalia.it" target="_blank">cavallini@faunalia.it</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Il 04/05/2018 01:18, Nyall Dawson ha scritto:<br>
<br>
> It's not a bug as much as very confusing 2.x behavior. The obscure<br>
> link between a "rendering" setting (OTF projection) and ellipsoidal<br>
> calculations (area/distance) is extremely confusing for users. We<br>
> couldn't change this in 2.x because of the API freeze and how embedded<br>
> this logic was in many areas of QGIS code and API.<br>
<br>
I understand, thanks for the explanation. Then why not disabling<br>
measurements when OTF is off? giving a totally false measurement does<br>
not seem a good idea.<br>
I believe 2.18 will be around for a good while, and I hate sending<br>
around wrong results of which the user has no clue whatsoever.<br>
Still unclear to me why the lack of ellipsoid would lead to 40% error,<br>
but that's my ignorance.<br>
All the best.<br>
<span class="im">-- </span><br>
<span class="im">Paolo Cavallini - <a href="http://www.faunalia.eu" target="_blank">
www.faunalia.eu</a></span><br>
<span class="im">QGIS & PostGIS courses: <a href="http://www.faunalia.eu/training.html" target="_blank">
http://www.faunalia.eu/training.html</a></span><br>
<span class="im"><a href="https://www.google.com/trends/explore?date=all&geo=IT&q=qgis,arcgis" target="_blank">https://www.google.com/trends/explore?date=all&geo=IT&q=qgis,arcgis</a></span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">_______________________________________________<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" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>