]> granicus.if.org Git - postgis/commitdiff
Have gserialized_get_gbox_p always return a round-to-float box
authorSandro Santilli <strk@keybit.net>
Mon, 21 Nov 2011 12:03:48 +0000 (12:03 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 21 Nov 2011 12:03:48 +0000 (12:03 +0000)
That is, even when computing the box from scratch.
This makes the box always float-oriented,
consistently between cached and computed boxes.
Closes (hopefully forever) bug #1023.
Includes testcase otherwise failing.

git-svn-id: http://svn.osgeo.org/postgis/trunk@8203 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/g_serialized.c
regress/tickets.sql
regress/tickets_expected

index e6181bd190eafba6c352e3c4626c0c0951137cbe..ede41872c95e329488a2e1b308c21c3ce642d523 100644 (file)
@@ -266,6 +266,7 @@ int gserialized_get_gbox_p(const GSERIALIZED *geom, GBOX *box)
                /* See http://trac.osgeo.org/postgis/ticket/1023 */
                lwgeom = lwgeom_from_gserialized(geom);
                ret = lwgeom_calculate_gbox(lwgeom, box);
+               gbox_float_round(box);
                lwgeom_free(lwgeom);
        }
        return ret;
index 97b9087a8a85e2ab18085c16e204c4a62fde83a7..9f0e8265ea58ae386d4211450b560cbd2399a9c8 100644 (file)
@@ -405,6 +405,10 @@ select '#1060', ST_Relate(ST_GeomFromText('POINT EMPTY',4326), ST_GeomFromText('
 WITH p AS ( SELECT 'POINT(832694.188 816254.625)'::geometry as g ) 
 SELECT '#1273', st_equals(p.g, postgis_addbbox(p.g)) from p;
 
+-- Another for #1273 --
+WITH p AS ( SELECT 'MULTIPOINT((832694.188 816254.625))'::geometry as g ) 
+SELECT '#1273.1', st_equals(p.g, postgis_dropbbox(p.g)) from p;
+
 -- Clean up
 DELETE FROM spatial_ref_sys;
 
index fbd841497f7702c1f27e9f75288928a2b9b93ff0..1f6ebbe713227f093e2d48153d8815c6c28eb552 100644 (file)
@@ -119,3 +119,4 @@ ERROR:  First argument must be a LINESTRING
 #1023.b|t
 #1060|FFFFFFFF2
 #1273|t
+#1273.1|t