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








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On August 31st, 2010, 7:21 a.m., <b>Torsten Rahn</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="/r/5142/diff/2/?file=34717#file34717line35" style="color: black; font-weight: bold; text-decoration: underline;">/trunk/KDE/kdeedu/marble/src/lib/routing/instructions/RoutingPoint.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">qreal RoutingPoint::lat() const</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">35</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="n">qreal</span> <span class="n">RoutingPoint</span><span class="o">::</span><span class="n">bearing</span><span class="p">(</span> <span class="k">const</span> <span class="n">RoutingPoint</span> <span class="o">&amp;</span><span class="n">other</span> <span class="p">)</span> <span class="k">const</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I read that you need stuff &quot;duplicated&quot; in this case. So does it make sense to introduce something similar in addition inside GeoDataCoordinates:

qreal GeoDataCoordinates::bearing( const GeoDataCoordinates &amp; other ) const ?

</pre>
 </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Yes, probably.</pre>
<br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On August 31st, 2010, 7:21 a.m., <b>Torsten Rahn</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="/r/5142/diff/2/?file=34717#file34717line45" style="color: black; font-weight: bold; text-decoration: underline;">/trunk/KDE/kdeedu/marble/src/lib/routing/instructions/RoutingPoint.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">qreal RoutingPoint::lat() const</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">45</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="n">qreal</span> <span class="n">RoutingPoint</span><span class="o">::</span><span class="n">distance</span><span class="p">(</span> <span class="k">const</span> <span class="n">RoutingPoint</span> <span class="o">&amp;</span><span class="n">other</span> <span class="p">)</span> <span class="k">const</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">ok, this distance method&#39;s implementation is completely different from the one used in GeoDataCoordinates. Should we adjust the one in GeoDataCoordinates? What is your opinion about this?</pre>
 </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Hmm, good question. I had this implementation lying around and knew it was working well. IIRC it&#39;s quite precise, but a bit slower. Possibly I don&#39;t need it to be too precise.

I compared the runtime of the three implementations (the one above as iteratitve, MarbleMath::distanceSphere and MarbleMath::distanceSphereApprox as the other two) with these results (1.000.000 iterations of the same distance calcuation):

distanceIterative: 1548 ms. 
distanceSphere:     328 ms. 
distanceApprox:     363 ms.

I wasn&#39;t suprised that the one implemented above is slower, but Marble&#39;s distanceApprox being slower than distanceSphere surprised me. Guess I&#39;ll switch to distanceSphere in my code. We should consider removing/deprecating distanceSphereApprox as well (it&#39;s not used in Marble).
</pre>
<br />




<p>- Dennis</p>


<br />
<p>On August 26th, 2010, 12:12 p.m., Dennis Nienhüser wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://svn.reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for marble.</div>
<div>By Dennis Nienhüser.</div>


<p style="color: grey;"><i>Updated 2010-08-26 12:12:36</i></p>




<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;">This completes offline routing by adding support for the generation of human readable instructions for both gosmore and routino. With this committed, we can start working on an important use case: Dynamic, offline route adjustments on Maemo (automatically calculate a new route when the user deviates too much from the original one).

The patch is based on gosmore-instructions [1] and planned to fully replace it. Gosmore-instructions is already used in [2] and I plan to continue supporting this usage. Therefore a new binary routing-instructions is included (replacing the former gosmore-instructions) similar to Marble&#39;s tilecreator. It is meant to be used on a webserver and therefore kept minimalistic (only depending on QtCore). Just like the gosmore and routino runner plugins it uses the new classes in src/lib/routing/instructions/. You&#39;ll notice some (intentional) duplication in the added code: Yet another point class and methods to calculate geodetic distances. This is needed to avoid the heavier GUI dependencies which would come in when using the Marble classes. This in turn imposes a problem on shared webservers.

There are two types of usage:

Online-Routing via some webserver (e.g. dev.osm.org)
PHP-Frontend =&gt; system ( gosmore | routing-instructions ) =&gt; KML =&gt; Marble =&gt; GeoDataDocument

Offline-Routing via the local system
Marble =&gt; QProcess( gosmore ) =&gt; Instruction generation =&gt; GeoDataDocument

The code used to generate the instructions itself isn&#39;t much magic: It parses a csv like format (waypoints and road names), groups them by road name to get the instruction points, calculates the angles between adjacent roads and generates human readable instructions from that information.

[1] http://gitorious.org/gosmore-instructions
[2] http://wiki.openstreetmap.org/wiki/Osm.org_Routing_Demo
</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;">A recent gosmore version from SVN (output with 6 fields and support for roundabouts, see screenshot)
An older gosmore version (the one shipped with Ubuntu Lucid, output with 5 fields, different .pak format)
Routino version 1.4.1
</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>/trunk/KDE/kdeedu/marble/data/bitmaps/turn-around.png <span style="color: grey">(UNKNOWN)</span></li>

 <li>/trunk/KDE/kdeedu/marble/data/bitmaps/turn-continue.png <span style="color: grey">(UNKNOWN)</span></li>

 <li>/trunk/KDE/kdeedu/marble/data/bitmaps/turn-left.png <span style="color: grey">(UNKNOWN)</span></li>

 <li>/trunk/KDE/kdeedu/marble/data/bitmaps/turn-right.png <span style="color: grey">(UNKNOWN)</span></li>

 <li>/trunk/KDE/kdeedu/marble/data/bitmaps/turn-roundabout-far.png <span style="color: grey">(UNKNOWN)</span></li>

 <li>/trunk/KDE/kdeedu/marble/data/bitmaps/turn-roundabout-first.png <span style="color: grey">(UNKNOWN)</span></li>

 <li>/trunk/KDE/kdeedu/marble/data/bitmaps/turn-roundabout-second.png <span style="color: grey">(UNKNOWN)</span></li>

 <li>/trunk/KDE/kdeedu/marble/data/bitmaps/turn-roundabout-third.png <span style="color: grey">(UNKNOWN)</span></li>

 <li>/trunk/KDE/kdeedu/marble/data/bitmaps/turn-sharp-left.png <span style="color: grey">(UNKNOWN)</span></li>

 <li>/trunk/KDE/kdeedu/marble/data/bitmaps/turn-sharp-right.png <span style="color: grey">(UNKNOWN)</span></li>

 <li>/trunk/KDE/kdeedu/marble/data/bitmaps/turn-slight-left.png <span style="color: grey">(UNKNOWN)</span></li>

 <li>/trunk/KDE/kdeedu/marble/data/bitmaps/turn-slight-right.png <span style="color: grey">(UNKNOWN)</span></li>

 <li>/trunk/KDE/kdeedu/marble/data/svg/turn-indicators.svg <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/CMakeLists.txt <span style="color: grey">(1167911)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/lib/CMakeLists.txt <span style="color: grey">(1167911)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataExtendedData.h <span style="color: grey">(1167911)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataExtendedData.cpp <span style="color: grey">(1167911)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/lib/libmarble.qrc <span style="color: grey">(1167911)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/lib/routing/RoutingModel.cpp <span style="color: grey">(1167911)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/lib/routing/instructions/InstructionTransformation.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/lib/routing/instructions/InstructionTransformation.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/lib/routing/instructions/RoutingInstruction.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/lib/routing/instructions/RoutingInstruction.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/lib/routing/instructions/RoutingPoint.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/lib/routing/instructions/RoutingPoint.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/lib/routing/instructions/RoutingWaypoint.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/lib/routing/instructions/RoutingWaypoint.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/lib/routing/instructions/WaypointParser.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/lib/routing/instructions/WaypointParser.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/plugins/runner/gosmore/GosmoreRunner.cpp <span style="color: grey">(1167911)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/plugins/runner/routino/RoutinoRunner.cpp <span style="color: grey">(1167911)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/routing-instructions/CMakeLists.txt <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdeedu/marble/src/routing-instructions/main.cpp <span style="color: grey">(PRE-CREATION)</span></li>

</ul>

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



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

<div>

 <a href="http://svn.reviewboard.kde.org/r/5142/s/487/"><img src="http://svn.reviewboard.kde.org/media/uploaded/images/2010/08/25/marble-routing-instructions_400x100.png" style="border: 1px black solid;" alt="" /></a>

 <a href="http://svn.reviewboard.kde.org/r/5142/s/488/"><img src="http://svn.reviewboard.kde.org/media/uploaded/images/2010/08/26/marble-turn-indicator-icons_400x100.png" style="border: 1px black solid;" alt="" /></a>

</div>


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








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