Hi Puneet,

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.

Jesse

Examples:
As displayed in QGIS:
 . . . 

From the database perspective:
smddb_dev=# SELECT AsText(scene_geom) FROM scene_locator WHERE id = 28716;
                                                                                                  astext                                                                                                   
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 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)))
(1 row)

smddb_dev=# SELECT AsText(ST_Centroid(scene_geom)) FROM scene_locator WHERE id = 28716;
                   astext                   
--------------------------------------------
 POINT(-27.1147737791952 -17.9181176096631)
(1 row)


smddb_dev=# SELECT ST_Contains(scene_geom, GeomFromText('POINT(-179.8 -17.8)', 4326)) FROM scene_locator WHERE id = 28716;
 st_contains 
-------------
 t
(1 row)

On Sep 15, 2011, at 4:06 PM, Paul Ramsey wrote:

Might want to cross-post this to QGIS, it's more their problem than ours.

P

On Thu, Sep 15, 2011 at 1:22 PM, Puneet Kishor <[email protected]> wrote:
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 [http://dl.dropbox.com/u/3526821/PA.gmt] 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.

Any suggestion on the best way to handle this?

Puneet.
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to