<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>... but
basically I came to the conclusion that when people talk about an area
of something on Earth they really mean the area of a projection (am i
right about that?) and so i need to specify a projection before getting a
meaningful area. So i ended up with this code:</div><div><pre><code><span>wkt </span><span>=</span><span> </span><span>"POLYGON ((lon1 lat1, lon2 lat2, lon3 lat3))"</span><span>
poly </span><span>=</span><span> ogr</span><span>.</span><span>CreateGeometryFromWkt</span><span>(</span><span>wkt</span><span>)</span><span>
sr </span><span>=</span><span> osr</span><span>.</span><span>SpatialReference</span><span>()</span><span>
sr</span><span>.</span><span>SetWellKnownGeogCS</span><span>(</span><span>"NAD83"</span><span>)</span><span>
sr</span><span>.</span><span>SetProjCS</span><span>(</span><span>"SRS_PT_TRANSVERSE_MERCATOR"</span><span>)</span><span>
poly</span><span>.</span><span>AssignSpatialReference</span><span>(</span><span>sr</span><span>)</span><span>
poly</span><span>.</span><span>GetArea</span><span>()</span></code><a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank"></a></pre></div></div></blockquote><div>I might be dense, but it seems you are assigning sr as a specific transverse mercator, i.e.
UTM zone 18N, or a custom one centered on the centroid of your polygon. i.e. you don't have sufficient arguments.
</div><div> </div></div></div><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
<table style="border-top:1px solid #d3d4de">
<tr>
<td style="width:55px;padding-top:13px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td>
<td style="width:470px;padding-top:12px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link" target="_blank" style="color:#4453ea">www.avast.com</a>
</td>
</tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>