<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:10pt"><div><span><br></span></div><div>Hi Christian,</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Still use ST_Shift_Longitude()... it works best with points - polygons & linestrings can have topological issues that it doesn't address.</div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">SELECT st_extent(<br>test(# ST_GeomFromText('MULTIPOINT(162.06
56.144, -140.808 66.07, -153.301 57.36)',4326));<br> st_extent <br>-----------------------------------<br> BOX(-153.301 56.144,162.06 66.07)<br>(1 row)<br><br>test=# SELECT st_extent(ST_Shift_Longitude(<br>ST_GeomFromText('MULTIPOINT(162.06 56.144, -140.808 66.07, -153.301 57.36)',4326)));<br> st_extent <br>----------------------------------<br> BOX(162.06 56.144,219.192 66.07)<br>(1 row)</span><br><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: times new roman,new
york,times,serif; background-color: transparent; font-style: normal;">It depends if you want a 0-360 or +-180 extent... <br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">A better solution would perhaps be if ST_Extent() worked with the geography datatype - but the point sequence would need to implicitly determine the polygon extent across 180.</div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">To
be robust, you could maybe calculate the 0-360 and +-180 extents, & take the one with the smaller area?<br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">HTH,<br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Brent Wood<br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style:
normal;"><br></div> <div style="font-family: times new roman, new york, times, serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1"> <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Christian Gendreau <christiangendreau@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> postgis-users@lists.osgeo.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, May 23, 2014 3:05 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> [postgis-users] st_extent crossing international date line<br> </font> </div> <div class="y_msg_container"><br><div id="yiv1057372925"><div dir="ltr"><span style="font-family:arial, sans-serif;font-size:13px;">Hi there,</span><br style="font-family:arial, sans-serif;font-size:13px;"><br style="font-family:arial, sans-serif;font-size:13px;"><span style="font-family:arial,
sans-serif;font-size:13px;">I was wondering how can we perform an extent over the international date line?</span><br style="font-family:arial, sans-serif;font-size:13px;">
<br style="font-family:arial, sans-serif;font-size:13px;"><font face="arial, sans-serif">ST_Shift_Longitude seems perfect to compare 2 polygons over the IDL but what if I have 3 points (let say 2 in Alaska and 1 in Russia) and I want the get the extent?</font><div>
<font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">e.g. </font><span style="font-family:arial, sans-serif;">SELECT st_extent(</span><font face="arial, sans-serif"><div>ST_GeomFromText('MULTIPOINT(162.06 56.144, -140.808 66.07, -153.301 57.36)',4326));</div>
<div><br></div><div>Returns: BOX(-153.301 56.144,162.06 66.07), the longitude -140 was no included due to IDL.</div></font><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Regards,<br clear="all">
</font><div><br></div>Christian Gendreau</div></div></div></div><br>_______________________________________________<br>postgis-users mailing list<br><a ymailto="mailto:postgis-users@lists.osgeo.org" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br><br></div> </div> </div> </div></body></html>