[postgis-tickets] [PostGIS] #2529: Weird behavior in ST_FlipCoordinates

PostGIS trac at osgeo.org
Tue Nov 5 10:35:12 PST 2013


#2529: Weird behavior in ST_FlipCoordinates
-----------------------------------------------------+----------------------
 Reporter:  marcelosoaressouza                       |       Owner:  pramsey
     Type:  defect                                   |      Status:  new    
 Priority:  medium                                   |   Milestone:         
Component:  postgis                                  |     Version:  trunk  
 Keywords:  ST_FlipCoordinates, PostGIS, PostgreSQL  |  
-----------------------------------------------------+----------------------
 Using Debian GNU/Linux 7.2.0 (amd64), PostgreSQL 9.3.1 and PostGIS
 2.2.0dev r12082 (GEOS 3.3.3 and GDAL 1.10.1).

   I've created a test Database with PostGIS extension and inserted two
 shapes (Polygon). Then i call the ST_FlipCoordinates function.

 ''  "SELECT id, ST_AsEWKT(ST_FlipCoordinates(shape)) AS
 ST_FlipCoordinates, ST_AsEWKT(shape) AS Shape FROM pol;"''

   And i got strange result, ST_FlipCoordinates, a IMMUTABLE function,
 changed some data in database.

 '''* In the First execution i got'''

 ''ID 1 (It's Okey)''

 ST_FlipCoordinates(shape): "SRID=4674;POLYGON((-50.09765625
 -2.63578857416661,-59.4140625 -15.4536802243458,-28.30078125
 -15.2841851140764,-29.53125 3.68885514314705,-50.09765625
 -2.63578857416661))"

 shape: "SRID=4674;POLYGON((-2.63578857416661
 -50.09765625,-15.4536802243458 -59.4140625,-15.2841851140764
 -28.30078125,3.68885514314705 -29.53125,-2.63578857416661 -50.09765625))"

 ''ID 2 (Wrong Result)''

 ST_FlipCoordinates(shape): "SRID=4674;POLYGON((-8.75479470243561
 -24.78515625,-23.2413461023861 -26.015625,-17.4764321971955
 -17.578125,-11.5230875068685 -17.2265625,-8.40716816360108
 -23.73046875,-8.75479470243561 -24.78515625))"

 shape: "SRID=4674;POLYGON((-8.75479470243561
 -24.78515625,-23.2413461023861 -26.015625,-17.4764321971955
 -17.578125,-11.5230875068685 -17.2265625,-8.40716816360108
 -23.73046875,-8.75479470243561 -24.78515625))"

 ''' * Second execution i got'''

 ''ID 1 (Continues Normal)''

 ST_FlipCoordinates(shape): "SRID=4674;POLYGON((-50.09765625
 -2.63578857416661,-59.4140625 -15.4536802243458,-28.30078125
 -15.2841851140764,-29.53125 3.68885514314705,-50.09765625
 -2.63578857416661))"

 shape: "SRID=4674;POLYGON((-2.63578857416661
 -50.09765625,-15.4536802243458 -59.4140625,-15.2841851140764
 -28.30078125,3.68885514314705 -29.53125,-2.63578857416661 -50.09765625))"

 ''ID 2 (Data Changed permanently and Flipped all data)''

 ST_FlipCoordinates(shape):"SRID=4674;POLYGON((-24.78515625
 -8.75479470243561,-26.015625 -23.2413461023861,-17.578125
 -17.4764321971955,-17.2265625 -11.5230875068685,-23.73046875
 -8.40716816360108,-24.78515625 -8.75479470243561))"

 shape: "SRID=4674;POLYGON((-24.78515625 -8.75479470243561,-26.015625
 -23.2413461023861,-17.578125 -17.4764321971955,-17.2265625
 -11.5230875068685,-23.73046875 -8.40716816360108,-24.78515625
 -8.75479470243561))"


   I've tested in PostgreSQL 9.1 and 9.2, with PostGIS 2.0.4 and 2.1.0 too.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2529>
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-tickets mailing list