<div dir="ltr"><div class="gmail_extra"><div class="gmail_extra">Hi Phil.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thank you for your answer. I've run this PostGIS code of yours:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><i><b><font color="#0000ff">SELECT ST_Area(the_geog, true) As sqm_spheroid</font></b></i></div><div class="gmail_extra"><i><b><font color="#0000ff">FROM (SELECT</font></b></i></div><div class="gmail_extra"><i><b><font color="#0000ff"><span class="" style="white-space:pre">     </span>geography(</font></b></i></div><div class="gmail_extra"><i><b><font color="#0000ff"><span class="" style="white-space:pre">          </span>ST_GeomFromText('POLYGON((50 0,-60 -5, -30 -30,50 0))', 4236)</font></b></i></div><div class="gmail_extra"><i><b><font color="#0000ff"><span class="" style="white-space:pre">       </span>)</font></b></i></div><div class="gmail_extra"><i><b><font color="#0000ff">) As x(the_geog);</font></b></i></div><div class="gmail_extra"><br></div><div class="gmail_extra">And I get this error:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><b><font color="#ff0000">ERROR:  ptarray_area_spheroid: cannot handle ptarray that crosses equator</font></b></div><div class="gmail_extra"><b><font color="#ff0000"><br></font></b></div><div class="gmail_extra"><b><font color="#ff0000" style="background-color:rgb(255,255,255)">********** Error **********</font></b></div><div class="gmail_extra"><b><font color="#ff0000" style="background-color:rgb(255,255,255)"><br></font></b></div><div class="gmail_extra"><b><font color="#ff0000" style="background-color:rgb(255,255,255)">ERROR: ptarray_area_spheroid: cannot handle ptarray that crosses equator</font></b></div><div class="gmail_extra"><b><font color="#ff0000" style="background-color:rgb(255,255,255)">SQL state: XX000</font></b></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">In my 2nd attempt, I tried changing the flag to false and it ran succesfully.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><b><i><font color="#0000ff">SELECT ST_Area(the_geog, false) As sqm_spheroid</font></i></b></div><div class="gmail_extra"><b><i><font color="#0000ff">FROM (SELECT</font></i></b></div><div class="gmail_extra"><b><i><font color="#0000ff"><span class="" style="white-space:pre">   </span>geography(</font></i></b></div><div class="gmail_extra"><b><i><font color="#0000ff"><span class="" style="white-space:pre">          </span>ST_GeomFromText('POLYGON((50 0,-60 -5, -30 -30,50 0))', 4236)</font></i></b></div><div class="gmail_extra"><b><i><font color="#0000ff"><span class="" style="white-space:pre">       </span>)</font></i></b></div><div class="gmail_extra"><b><i><font color="#0000ff">) As x(the_geog);</font></i></b></div><div class="gmail_extra"><br></div><div class="gmail_extra">But I still got the value <b><u>19582793771831</u></b> square meters, in opposition to the result <b><u>17050040174394.607</u></b> square meters obtained with getGeodesicArea.</div><div class="gmail_extra"><br></div><div class="gmail_extra">In a 3rd attempt, to find a good result, I changed the flag back to true and I tried new coordinates, in order to avoid crossing the equator, thus avoiding the error shown in the 1st attempt.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><font color="#0000ff"><b><i>SELECT ST_Area(the_geog, true) As sqm_spheroid</i></b></font></div><div class="gmail_extra"><font color="#0000ff"><b><i>FROM (SELECT</i></b></font></div><div class="gmail_extra"><font color="#0000ff"><b><i><span class="" style="white-space:pre"> </span>geography(</i></b></font></div><div class="gmail_extra"><font color="#0000ff"><b><i><span class="" style="white-space:pre">          </span>ST_GeomFromText('POLYGON((50 1, -60 1, -30 30, 50 1))', 4236)</i></b></font></div><div class="gmail_extra"><font color="#0000ff"><b><i><span class="" style="white-space:pre">       </span>)</i></b></font></div><div class="gmail_extra"><font color="#0000ff"><b><i>) As x(the_geog);</i></b></font></div><div class="gmail_extra"><br></div><div class="gmail_extra">Here I get <b><u>22380590293551.1</u></b> square meters, but using the same coordinates, I get <b><u>18843774494021.53</u></b> square meters using getGeodesicArea.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I'm sure OpenLayers works fine, but I have to do some unit tests, ans as you may understand, I have to compare the OpenLayers result with something else.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><b><u>Note</u></b>: I compares getLength with PostGIS and it worked just fine.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I'll try to reproduce my OpenLayers code, and respect the work secrecy at the same time. I'll send you a JSFiddle as soon as I've reproduced it.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I hope you can help me with this.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks a lot.</div><div class="gmail_extra"><br></div><div class="gmail_extra">João Rodrigues</div><div class="gmail_extra"><br></div></div></div>