<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Puneet,<div><br></div><div>We ran into this issue as well.  As a workaround for display in QGIS, we store those features that cross the date line as MULTIPOLYGONS that are split at 180/-180 line.  It is not ideal, but it works for display.  It does not work for some operations like ST_Centroid but others like ST_Contains will work.</div><div><br></div><div>Jesse</div><div><br></div><div>Examples:</div><div>As displayed in QGIS:</div><div><img height="100" width="104" apple-width="yes" apple-height="yes" src="cid:F5444203-AD68-48F1-9236-F62F0300C0DD@whrc.ad"> <b>. . . </b><img height="101" width="104" apple-width="yes" apple-height="yes" src="cid:E00C5821-BC2E-433F-BF5D-95E7656BAF61@whrc.ad"></div><div><br></div><div>From the database perspective:</div><div><div><font class="Apple-style-span" face="'Courier New'">smddb_dev=# SELECT AsText(scene_geom) FROM scene_locator WHERE id = 28716;</font></div><div><font class="Apple-style-span" face="'Courier New'">                                                                                                  astext                                                                                                   </font></div><div><font class="Apple-style-span" face="'Courier New'">-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</font></div><div><font class="Apple-style-span" face="'Courier New'"> MULTIPOLYGON(((179.665 -17.733,180 -17.6550440252,180 -18.2032131661,179.794 -18.251,179.665 -17.733)),((-180 -17.6550440252,-179.699 -17.585,-179.568 -18.103,-180 -18.2032131661,-180 -17.6550440252)))</font></div><div><font class="Apple-style-span" face="'Courier New'">(1 row)</font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><div><font class="Apple-style-span" face="'Courier New'">smddb_dev=# SELECT AsText(ST_Centroid(scene_geom)) FROM scene_locator WHERE id = 28716;</font></div><div><font class="Apple-style-span" face="'Courier New'">                   astext                   </font></div><div><font class="Apple-style-span" face="'Courier New'">--------------------------------------------</font></div><div><font class="Apple-style-span" face="'Courier New'"> POINT(-27.1147737791952 -17.9181176096631)</font></div><div><font class="Apple-style-span" face="'Courier New'">(1 row)</font></div></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><div><font class="Apple-style-span" face="'Courier New'">smddb_dev=# SELECT ST_Contains(scene_geom, GeomFromText('POINT(-179.8 -17.8)', 4326)) FROM scene_locator WHERE id = 28716;</font></div><div><font class="Apple-style-span" face="'Courier New'"> st_contains </font></div><div><font class="Apple-style-span" face="'Courier New'">-------------</font></div><div><font class="Apple-style-span" face="'Courier New'"> t</font></div><div><font class="Apple-style-span" face="'Courier New'">(1 row)</font></div></div><div><br></div><div><div>On Sep 15, 2011, at 4:06 PM, Paul Ramsey wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Might want to cross-post this to QGIS, it's more their problem than ours.<br><br>P<br><br>On Thu, Sep 15, 2011 at 1:22 PM, Puneet Kishor <<a href="mailto:punk.kish@gmail.com">punk.kish@gmail.com</a>> wrote:<br><blockquote type="cite">well, I've reached that point where I have to deal with data crossing the date line. I have kept a file on my Dropbox/Public folder [<a href="http://dl.dropbox.com/u/3526821/PA.gmt">http://dl.dropbox.com/u/3526821/PA.gmt</a>] which has a series of lat/lng pairs, one per line, making a single polygon. If I insert them into PostGIS as GEOMETRY, the resulting polygon is messed up. If I insert them as GEOGRAPHY, I can't view the polygon in Quantum GIS.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Any suggestion on the best way to handle this?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Puneet.<br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">postgis-users mailing list<br></blockquote><blockquote type="cite"><a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br></blockquote><blockquote type="cite"><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br></blockquote><blockquote type="cite"><br></blockquote>_______________________________________________<br>postgis-users mailing list<br><a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>http://postgis.refractions.net/mailman/listinfo/postgis-users<br><br></div></blockquote></div><br></div></body></html>