The algorithm we use for area on the spheroid is not great, and is sensitive to the poles and equator.<div><br></div><div><div>select st_area('POLYGON((0 0,45 -89.9999,90 0,0 0))'::geography);</div></div><div><br></div>
<div>An area for future work and/or funding, for sure.</div><div><br></div><div>P.</div><div><br><div class="gmail_quote">On Wed, Oct 26, 2011 at 1:04 PM, Jon Flitton <span dir="ltr"><<a href="mailto:jonathan.flitton@pb.com">jonathan.flitton@pb.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div lang="EN-GB" link="blue" vlink="purple"><div><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Hello everyone<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I’ve been trying to replicate some data in postgis that I have in sql server however the postgis version gives inconsistent results so I’m looking for help to see if I have something wrong.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">So the data I am creating is to segment the globe in to 8 triangles. The nodes are then located at the poles and the 4 “corners” of the equator.<u></u><u></u></p>
<p class="MsoNormal">I am using the geography type in both databases and wgs84<u></u><u></u></p><p class="MsoNormal">Below I give the text version of the polygons (as they come out of the database using STAsText in sqlserver and ST_AsText in postgis)<u></u><u></u></p>
<p class="MsoNormal">Also sown is the area of the polygon which is a simple check on the polys.<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">In sql server I have<u></u><u></u></p><p class="MsoNormal">
Text                                                                       Area<u></u><u></u></p><p class="MsoNormal">POLYGON ((0 0, 0 90, -90 0, 0 0))                63758201600773.2<u></u><u></u></p><p class="MsoNormal">
POLYGON ((-90 0, 0 90, 180 0, -90 0))       63758199375051<u></u><u></u></p><p class="MsoNormal">POLYGON ((180 0, 0 90, 90 0, 180 0))        63758199375051<u></u><u></u></p><p class="MsoNormal">POLYGON ((90 0, 0 90, 0 0, 90 0))               63758201600773.2<u></u><u></u></p>
<p class="MsoNormal">POLYGON ((0 0, 0 -90, 90 0, 0 0))                63758201600773.2<u></u><u></u></p><p class="MsoNormal">POLYGON ((90 0, 0 -90, -180 0, 90 0))       63758208279862.1<u></u><u></u></p><p class="MsoNormal">
POLYGON ((-180 0, 0 -90, -90 0, -180 0))  63758203826495.3<u></u><u></u></p><p class="MsoNormal">POLYGON ((-90 0, 0 -90, 0 0, -90 0))          63758201600773.2<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">
In postgis<u></u><u></u></p><table border="0" cellspacing="0" cellpadding="0" width="372" style="width:279.05pt;border-collapse:collapse"><tbody><tr style="min-height:15.0pt"><td width="256" nowrap valign="bottom" style="width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt">
<p class="MsoNormal"><span style="color:black">POLYGON((0 0,0 90,-90 0,0 0))<u></u><u></u></span></p></td><td width="116" nowrap valign="bottom" style="width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right">
<span style="color:black">63758234549478.10<u></u><u></u></span></p></td></tr><tr style="min-height:15.0pt"><td width="256" nowrap valign="bottom" style="width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt"><p class="MsoNormal">
<span style="color:black">POLYGON((-90 0,0 90,180 0,-90 0))<u></u><u></u></span></p></td><td width="116" nowrap valign="bottom" style="width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right">
<span style="color:black">63758234549482.70<u></u><u></u></span></p></td></tr><tr style="min-height:15.0pt"><td width="256" nowrap valign="bottom" style="width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt"><p class="MsoNormal">
<span style="color:black">POLYGON((180 0,0 90,90 0,180 0))<u></u><u></u></span></p></td><td width="116" nowrap valign="bottom" style="width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right">
<span style="color:black">63758234549478.20<u></u><u></u></span></p></td></tr><tr style="min-height:15.0pt"><td width="256" nowrap valign="bottom" style="width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt"><p class="MsoNormal">
<span style="color:black">POLYGON((90 0,0 90,0 0,90 0))<u></u><u></u></span></p></td><td width="116" nowrap valign="bottom" style="width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right">
<span style="color:black">148769213948756.00<u></u><u></u></span></p></td></tr><tr style="min-height:15.0pt"><td width="256" nowrap valign="bottom" style="width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt"><p class="MsoNormal">
<span style="color:black">POLYGON((0 0,0 -90,90 0,0 0))<u></u><u></u></span></p></td><td width="116" nowrap valign="bottom" style="width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt"><p class="MsoNormal"><span style="color:black">NaN<u></u><u></u></span></p>
</td></tr><tr style="min-height:15.0pt"><td width="256" nowrap valign="bottom" style="width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt"><p class="MsoNormal"><span style="color:black">POLYGON((90 0,0 -90,-180 0,90 0))<u></u><u></u></span></p>
</td><td width="116" nowrap valign="bottom" style="width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt"><p class="MsoNormal"><span style="color:black">NaN<u></u><u></u></span></p></td></tr><tr style="min-height:15.0pt">
<td width="256" nowrap valign="bottom" style="width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt"><p class="MsoNormal"><span style="color:black">POLYGON((-180 0,0 -90,-90 0,-180 0))<u></u><u></u></span></p></td>
<td width="116" nowrap valign="bottom" style="width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt"><p class="MsoNormal"><span style="color:black">NaN<u></u><u></u></span></p></td></tr><tr style="min-height:15.0pt">
<td width="256" nowrap valign="bottom" style="width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt"><p class="MsoNormal"><span style="color:black">POLYGON((-90 0,0 -90,0 0,-90 0))<u></u><u></u></span></p></td><td width="116" nowrap valign="bottom" style="width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;min-height:15.0pt">
<p class="MsoNormal"><span style="color:black">NaN<u></u><u></u></span></p></td></tr></tbody></table><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">So the first three in post gis are similar in area  (I assume a slightly different geoid is used) but the 4<sup>th</sup> one is very different and the southern hemisphere are all wrong.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Any ideas?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p></div></div><br>_______________________________________________<br>

postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br></div>