[postgis-devel] [PostGIS] #1975: ST_Equals returns false on result of calling ST_Shift_Longitude twice with date line longitude
PostGIS
trac at osgeo.org
Tue Sep 4 06:36:11 PDT 2012
#1975: ST_Equals returns false on result of calling ST_Shift_Longitude twice with
date line longitude
---------------------------+------------------------------------------------
Reporter: realityexists | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 2.1.0
Component: postgis | Version: trunk
Keywords: |
---------------------------+------------------------------------------------
r10194, PostgreSQL 9.1.4, Windows 7 x64
If I understand ST_Shift_Longitude correctly calling it twice is supposed
to return the original value. Doing a text comparison on the return value
seems to confirm this, ''but'' ST_Equals returns false when there is a 180
longitude in the shape.
Try this to reproduce:
{{{
WITH data AS
(
SELECT ST_GeomFromText('POLYGON((170 54,180 60,-172 64,-168 65,170
54))', 4326) AS shape
)
, ops AS
(
SELECT shape, ST_Shift_Longitude(ST_Shift_Longitude(shape)) AS
reshifted
FROM data
)
SELECT ST_Equals(shape, reshifted), ST_AsEWKT(shape) =
ST_AsEWKT(reshifted) AS text_equals
FROM ops
}}}
st_equals is false, but text_equals is true.
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1975>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-devel
mailing list