<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hello everyone<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></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.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></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.<o:p></o:p></p><p class=MsoNormal>I am using the geography type in both databases and wgs84<o:p></o:p></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)<o:p></o:p></p><p class=MsoNormal>Also sown is the area of the polygon which is a simple check on the polys.<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>In sql server I have<o:p></o:p></p><p class=MsoNormal>Text                                                                       Area<o:p></o:p></p><p class=MsoNormal>POLYGON ((0 0, 0 90, -90 0, 0 0))                63758201600773.2<o:p></o:p></p><p class=MsoNormal>POLYGON ((-90 0, 0 90, 180 0, -90 0))       63758199375051<o:p></o:p></p><p class=MsoNormal>POLYGON ((180 0, 0 90, 90 0, 180 0))        63758199375051<o:p></o:p></p><p class=MsoNormal>POLYGON ((90 0, 0 90, 0 0, 90 0))               63758201600773.2<o:p></o:p></p><p class=MsoNormal>POLYGON ((0 0, 0 -90, 90 0, 0 0))                63758201600773.2<o:p></o:p></p><p class=MsoNormal>POLYGON ((90 0, 0 -90, -180 0, 90 0))       63758208279862.1<o:p></o:p></p><p class=MsoNormal>POLYGON ((-180 0, 0 -90, -90 0, -180 0))  63758203826495.3<o:p></o:p></p><p class=MsoNormal>POLYGON ((-90 0, 0 -90, 0 0, -90 0))          63758201600773.2<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>In postgis<o:p></o:p></p><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=372 style='width:279.05pt;margin-left:-.75pt;border-collapse:collapse'><tr style='height:15.0pt'><td width=256 nowrap valign=bottom style='width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:EN-GB'>POLYGON((0 0,0 90,-90 0,0 0))<o:p></o:p></span></p></td><td width=116 nowrap valign=bottom style='width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:EN-GB'>63758234549478.10<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=256 nowrap valign=bottom style='width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:EN-GB'>POLYGON((-90 0,0 90,180 0,-90 0))<o:p></o:p></span></p></td><td width=116 nowrap valign=bottom style='width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:EN-GB'>63758234549482.70<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=256 nowrap valign=bottom style='width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:EN-GB'>POLYGON((180 0,0 90,90 0,180 0))<o:p></o:p></span></p></td><td width=116 nowrap valign=bottom style='width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:EN-GB'>63758234549478.20<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=256 nowrap valign=bottom style='width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:EN-GB'>POLYGON((90 0,0 90,0 0,90 0))<o:p></o:p></span></p></td><td width=116 nowrap valign=bottom style='width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:EN-GB'>148769213948756.00<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=256 nowrap valign=bottom style='width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:EN-GB'>POLYGON((0 0,0 -90,90 0,0 0))<o:p></o:p></span></p></td><td width=116 nowrap valign=bottom style='width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:EN-GB'>NaN<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=256 nowrap valign=bottom style='width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:EN-GB'>POLYGON((90 0,0 -90,-180 0,90 0))<o:p></o:p></span></p></td><td width=116 nowrap valign=bottom style='width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:EN-GB'>NaN<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=256 nowrap valign=bottom style='width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:EN-GB'>POLYGON((-180 0,0 -90,-90 0,-180 0))<o:p></o:p></span></p></td><td width=116 nowrap valign=bottom style='width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:EN-GB'>NaN<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=256 nowrap valign=bottom style='width:192.15pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:EN-GB'>POLYGON((-90 0,0 -90,0 0,-90 0))<o:p></o:p></span></p></td><td width=116 nowrap valign=bottom style='width:86.9pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:EN-GB'>NaN<o:p></o:p></span></p></td></tr></table><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></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.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Any ideas?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>