<div dir="ltr"><div>Yes, you are correct, that was one of my first attempts and was wrong because I don't really understand these projection systems.</div><div>I now have a better one which sort of works and produces areas in meters by setting first system to</div><div>sr.SetWellKnownGeogCS("EPSG:4326")</div><div>Now I am struggling with selecting the projection coordinate system.  Some suggested that I use cylindrical projection <span class="gmail-comment-copy"> EPSG:9835 which should preserve the area anywhere on the planet but when I try <br></span></div><div><span class="gmail-comment-copy">sr_proj.ImportFromEPSG(9835)</span></div><div><span class="gmail-comment-copy">I get error:<br></span></div><div><span class="gmail-comment-copy">PROJ: proj_create_from_database: crs not found</span></div><div><span class="gmail-comment-copy"><br></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 18, 2020 at 9:50 PM Michael Patrick <<a href="mailto:geodesy99@gmail.com" target="_blank">geodesy99@gmail.com</a>> wrote:<br></div><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 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="gmail-m_-2581199688950320765gmail-m_6579958654730313444DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
<table style="border-top:1px solid rgb(211,212,222)">
        <tbody><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="" style="width: 46px; height: 29px;" width="46" height="29"></a></td>
                <td style="width:470px;padding-top:12px;color:rgb(65,66,78);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" style="color:rgb(68,83,234)" target="_blank">www.avast.com</a>
                </td>
        </tr>
</tbody></table><a href="#m_-2581199688950320765_m_6579958654730313444_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a></blockquote></div>