<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/122989/">https://git.reviewboard.kde.org/r/122989/</a>
     </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">You are reinventing lots of wheels here - we have similar methods in place already. Please check GeoDataLineString::length(). Make sure that whatever you implement based on that also works for other planets and not only for the Earth :-)</p></pre>
 <br />









<p>- Torsten Rahn</p>


<br />
<p>On März 17th, 2015, 3:45 nachm. UTC, hardik  beladiya wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for Marble and Torsten Rahn.</div>
<div>By hardik  beladiya.</div>


<p style="color: grey;"><i>Updated März 17, 2015, 3:45 nachm.</i></p>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=345263">345263</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
marble
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Objective : Integration of marble with haversine formula  for calculation of path distance .</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Research: There are few method from which we can calculate distance between two latitude and longitude point or we can say geographic coordinate . Some of the method are given here
1. haversine method
2.Spherical Law of Cosines
3.Equirectangular approximation
4.Bearing</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Choosing right Method
I choose haversine  method because haversine formula   calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills ) and  remains particularly well-conditioned for numerical computa­tion even at small distances’ – unlike calculations based on the spherical law of cosines</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Distance calculation using the 'haversine' formula which is basically calculate the shotrtest distance between two point in earth surface</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Haversine A  = sin²(??/2) + cos ?1 ? cos ?2 ? sin²(??/2) ;
c = 2 ? atan2( ?A, ?(1?A) )
d = R ? c </p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">A= is the square of half the chord length between the points.
R=mean radius of earth =6371
c =is the angular distance in radians</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">solution.
1). First of all we make function to calculate the distance between two point 
    eg. pointdistance(  lon,  lat , lon1,  lat1)
2)After we call this pointdistace() function  in the fuction pathdistance() and pass the value of       parameter and calculate the distance iterative.
    eg. Pathdistance(){
        for size of the vector -1 {
    distance +=pointdistance(  lon,  lat , lon1,  lat1);
    } <br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
}</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">yes tested with the google map and the distance coming from the google map and our marble are same :)</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/plugins/render/annotate/EditPolylineDialog.h <span style="color: grey">(4d383b8)</span></li>

 <li>src/plugins/render/annotate/EditPolylineDialog.cpp <span style="color: grey">(a99a3e9)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/122989/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>







  </div>
 </body>
</html>