<div dir="ltr">Hi Barend,<div><br></div><div>Thanks for replying.</div><div>I will try passing the radius of the Earth in kilometers to the strategy constructor.</div><div><br></div><div>Thanks.</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Apr 14, 2014 at 5:44 PM, Barend Gehrels <span dir="ltr">&lt;<a href="mailto:barend@xs4all.nl" target="_blank">barend@xs4all.nl</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div>Hi Fernando,<br>
      <br>
      <br>
      Fernando Pelliccioni wrote On 14-4-2014 20:36:<br>
    </div><div><div class="h5">
    <blockquote type="cite">
      <div dir="ltr">Any comments?
        <div><br>
        </div>
        <div>Thanks!</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Mon, Apr 7, 2014 at 10:28 AM,
          Fernando Pelliccioni <span dir="ltr">&lt;<a href="mailto:fpelliccioni@gmail.com" target="_blank">fpelliccioni@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>Hi all,</div>
              <div><br>
              </div>
              <div>I run the &quot;area (with strategy)&quot; example shown on </div>
              <div><br>
              </div>
              <div><a href="http://www.boost.org/doc/libs/1_55_0/libs/geometry/doc/html/geometry/reference/algorithms/area/area_2_with_strategy.html" target="_blank">http://www.boost.org/doc/libs/1_55_0/libs/geometry/doc/html/geometry/reference/algorithms/area/area_2_with_strategy.html</a></div>

              <div><br>
              </div>
              <div>I&#39;m interested in getting the geodetic area (the
                second one of the code below)</div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div><span style="white-space:pre-wrap"> </span>#include
                &lt;iostream&gt;</div>
              <div><span style="white-space:pre-wrap"> </span>#include
                &lt;boost/geometry.hpp&gt;<br>
              </div>
              <div><span style="white-space:pre-wrap"> </span>#include
                &lt;boost/geometry/geometries/polygon.hpp&gt;</div>
              <div><span style="white-space:pre-wrap"> </span>#include
                &lt;boost/geometry/io/wkt/wkt.hpp&gt;</div>
              <div><br>
              </div>
              <div><span style="white-space:pre-wrap"> </span>namespace
                bg = boost::geometry;</div>
              <div><br>
              </div>
              <div><span style="white-space:pre-wrap"> </span>int
                main()</div>
              <div><span style="white-space:pre-wrap"> </span>{</div>
              <div><span style="white-space:pre-wrap"> </span>    //
                Calculate the area of a spherical polygon (for latitude:
                0 at equator)</div>
              <div><span style="white-space:pre-wrap"> </span>  
                 bg::model::polygon&lt;bg::model::point&lt;float, 2,
                bg::cs::spherical_equatorial&lt;bg::degree&gt; &gt; &gt;
                sph_poly;</div>
              <div><span style="white-space:pre-wrap"> </span>  
                 bg::read_wkt(&quot;POLYGON((0 0,0 45,45 0,0 0))&quot;, sph_poly);</div>
              <div><span style="white-space:pre-wrap"> </span>  
                 double area = bg::area(sph_poly);</div>
              <div><span style="white-space:pre-wrap"> </span>  
                 std::cout &lt;&lt; &quot;Area: &quot; &lt;&lt; area &lt;&lt;
                std::endl;</div>
              <div><br>
              </div>
              <div><span style="white-space:pre-wrap"> </span>  
                 return 0;</div>
              <div>
                <span style="white-space:pre-wrap"> </span>}</div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>The code above prints out:</div>
              <div><span style="white-space:pre-wrap"> </span>Area:
                0.339837</div>
              <div><br>
              </div>
              <div>In this case, what is the unit of the area?</div>
              <div><br>
              </div>
              <div>The documentation states that:</div>
              <div><span style="white-space:pre-wrap"> </span>Returns
                the area on a unit sphere (or another sphere, if
                specified as such in the constructor of the strategy)</div>
              <div><br>
              </div>
              <div>Sorry, but my knowledge of geography is limited.</div>
              <div>How can I transform that number to square kilometers,
                square miles, ...?<br>
              </div>
              <div><br>
              </div>
              <div>Thank you very much.</div>
            </div>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br></div></div>
    You can convert this to the Earth-considered-as-a-perfect-sphere by
    passing the radius of the Earth in the strategy. This is more or
    less what the documentation says. If you pass it in Kilometers you
    will get square kilometers, if you pass miles you get miles back.<br>
    <br>
    However, the Earth is not a perfect sphere so the above is a rough
    approximation. At this moment we don&#39;t have anything better yet,
    because most of the Geographic Coordinate System is still in
    extensions and does not contain all functionality yet.<br>
    <br>
    Regards, Barend<br>
    <br>
    <br>
    <br>
    <br>
  </div>

<br>_______________________________________________<br>
Geometry mailing list<br>
<a href="mailto:Geometry@lists.boost.org">Geometry@lists.boost.org</a><br>
<a href="http://listarchives.boost.org/mailman/listinfo.cgi/geometry" target="_blank">http://listarchives.boost.org/mailman/listinfo.cgi/geometry</a><br>
<br></blockquote></div><br></div>

