[postgis-users] problem with data crossing the date line

562 views
Skip to first unread message

Puneet Kishor

unread,
Sep 15, 2011, 3:22:08 PM9/15/11
to PostGIS Users Discussion
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
postgi...@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Paul Ramsey

unread,
Sep 15, 2011, 4:06:48 PM9/15/11
to PostGIS Users Discussion
Might want to cross-post this to QGIS, it's more their problem than ours.

P

Puneet Kishor

unread,
Sep 15, 2011, 4:49:06 PM9/15/11
to PostGIS Users Discussion

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

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

Righto. But, let me ask this... is inserting such data in Pg as `GEOGRAPHY(Polygon,4326)` the right thing to do? Doing it as GEOMETRY produces mostly nonsense.

Just want to cover all the bases.

Jesse Bishop

unread,
Sep 22, 2011, 3:40:18 PM9/22/11
to PostGIS Users Discussion
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)

Paul Ramsey

unread,
Sep 22, 2011, 3:47:20 PM9/22/11
to PostGIS Users Discussion
Note that while a multi-poly split at the dateline will (a) render
find and (b) give right answers to all functions, it will do bad
things (if you have enough of them) to your index, since the index
bbox of the feature will cover the whole world. So even tiny queries
in the middle of the world will end up wading through the split
features as possible cases turned up by the index.

P.

On Thu, Sep 22, 2011 at 12:40 PM, Jesse Bishop <jbi...@whrc.org> wrote:
>
> 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:

>  . . .

pcr...@pcreso.com

unread,
Sep 23, 2011, 12:26:48 AM9/23/11
to PostGIS Users Discussion
Or use 0-360 longitudes for a single geometry polygon. Valid EPSG:4326 coordinate space.

The problem then arises if you have other data in a +-180 space...

Brent Wood

--- On Fri, 9/23/11, Paul Ramsey <pra...@opengeo.org> wrote:

Sandro Santilli

unread,
Sep 23, 2011, 3:20:23 AM9/23/11
to pcr...@pcreso.com, PostGIS Users Discussion
On Thu, Sep 22, 2011 at 09:26:48PM -0700, pcr...@pcreso.com wrote:
> Or use 0-360 longitudes for a single geometry polygon.
> Valid EPSG:4326 coordinate space.
>
> The problem then arises if you have other data in a +-180 space...

ST_WrapX lets you pick an arbitrary X value for wrapping, so you can
wrap where you know there's nothing crossing.
See http://trac.osgeo.org/postgis/ticket/454

--strk;

() Free GIS & Flash consultant/developer
/\ http://strk.keybit.net/services.html

Barend Köbben

unread,
Dec 22, 2011, 6:57:48 AM12/22/11
to PostGIS Users Discussion
Hopefully the people responsible for Spatialreference.org are on this list
too (?):

The server is returning a

Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /
<http://spatialreference.org/>.
Reason: Error reading from remote server

Yours,

--
Barend Köbben


Faculty of Geo-Information Science and Earth Observation (ITC)
University of Twente
Chamber of Commerce: 501305360000

E-mail disclaimer
The information in this e-mail, including any attachments, is intended for the addressee only. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or action in relation to the content of this information is strictly prohibited. If you have received this e-mail by mistake, please delete the message and any attachment and inform the sender by return e-mail. ITC accepts no liability for any error or omission in the message content or for damage of any kind that may arise as a result of e-mail transmission.

Barend Köbben

unread,
Oct 16, 2012, 11:00:39 AM10/16/12
to PostGIS Users Discussion

FOSS4G 2013 Nottingham "Geo for All" 

[follow the news on http://2013.foss4g.org for upcoming CfP fro other tracks, workshops, etcetera]

Academic Track:  “Science for Open Source, Open Source for Science”

First Call for Papers


The FOSS4G 2013 Academic Track is bringing together researchers, developers, users and practitioners carrying out research and development in the geospatial and the free and open source fields. 

With the Academic Track motto “Science for Open Source, Open Source for Science”, we aim to attract academic papers describing

  • the use of open source geospatial software and data, in and for scientific research, as well as

  • academic endeavours to conceptualize, create, assess, and teach open source geospatial software and data.

Based on these categories, to promote a strong connection between the Academic Track and the other elements of FOSS4G 2013, we hope for contributions within the following themes:

  • Data Quality, Software Quality and Service Quality

  • Community Building

  • Doing more for less: Assessment of costs and benefits of open source applications and open source business models

  • Use of Open Data to inform public services

  • FOSS vs. FOSS4g: Is spatial special?
  • Architectures and frameworks for open source software and data
  • Teaching Geospatial Sciences with open source solutions
  • Open Source GIS application use cases : Government, Participatory GIS, Location based services, Health, Energy, Water, Climate change, etc. 
  • Human-Computer Interfaces and Usability in and around Open GI systems

We invite academics and researchers to submit full papers in English, of maximum 8,000 words, before the deadline of 1 February 2013. More detailed requirements, regarding layout, formatting and the submission process, will be published in the 2nd Call for Papers, expected late November 2012.

Your contributions will be reviewed (double-blind) by a diverse reviewing committee of experts in the field, who will be asked to assess the papers on originality and academic rigour, as well as interest for the wider FOSS4G community. We expect to select 20-25 papers for presentation and publication. From this selection, a maximum of 8-10 papers will be given the opportunity for inclusion in a special issue of the renowned international journal Transactions in GIS [1]The remaining papers will be published in the online OSGEO Journal [2].

We would like to specifically invite “early stage researchers” (PhD students, PostDocs) to use this opportunity to aim for a high-ranking publication.

Authors of all selected papers will be expected to present their work in detail in a separate Academic Track (with 20-30 minute slots), and will also be given the opportunity to pitch the central theme of their paper in short 'lightning' talks to the larger community, to generate attention and cross-pollenate with industry, developers and users.

Important Dates:

  • now: 1st Call for Papers

  • Late 2012: 2nd CfP (with detailed submission procedures and requirements)

  • 1 February 2013: Submission of full papers

  • 1 April 2013: Reviewing decisions

  • 1 May 2013: Paper revision deadline

  • 15 September 2013: publication of selected papers
      - 8-10 papers in Early View (on-line) Transactions in GIS
      - others in on-line OSGEO Journal
  • 17-21 September 2013: FOSS4G Conference

  • early 2014: printed issue Transactions in GIS


For questions, comments and remarks, contact the Academic Track co-chairs: 
  • Franz-Josef Behr (Stuttgart University of Applied Sciences): franz-josef.behr [at] hft-stuttgart.de
  • Barend Köbben (ITC-University of Twente): kobben [at] itc.nl


[1]: Transactions in GIS. Published by Wiley; included in ISI, with an impact factor of 0.54; edited by John P. Wilson, David O'Sullivan and Alexander Zipf. Print ISSN: 1361-1682 Online ISSN: 1467-9671. http://eu.wiley.com/WileyCDA/WileyTitle/productCd-TGIS.html

[2]: OSGEO Journal, the official Journal of the Open Source Geospatial Foundation; http://journal.osgeo.org/index.php/journal





Reply all
Reply to author
Forward
0 new messages