Opened 10 years ago

Closed 10 years ago

#1975 closed defect (wontfix)

ST_Equals returns false on result of calling ST_Shift_Longitude twice with date line longitude

Reported by: realityexists Owned by: pramsey
Priority: medium Milestone: PostGIS 2.1.0
Component: postgis Version: master
Keywords: Cc:


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.

Change History (1)

comment:1 by strk, 10 years ago

Resolution: wontfix
Status: newclosed

Interesting. But oh how I'd love to see this function replaced by ST_WrapX …

Anyway, the polygon is self-intersecting, thus ST_Equals(shape,shape) fails too

Note: See TracTickets for help on using tickets.