]> granicus.if.org Git - postgis/commitdiff
ST_SnapToGrid: retain type on empty return (#1695)
authorSandro Santilli <strk@keybit.net>
Mon, 19 Mar 2012 12:07:39 +0000 (12:07 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 19 Mar 2012 12:07:39 +0000 (12:07 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9516 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/lwgeom_functions_analytic.c
regress/tickets.sql
regress/tickets_expected

index eee1d740d881965dc1f4e2b87853cf2d2f187fa4..3d2f78c51b673d091552723ece7a9f4187612379 100644 (file)
@@ -473,7 +473,7 @@ lwcollection_grid(LWCOLLECTION *coll, gridspec *grid)
                if ( g ) geoms[ngeoms++] = g;
        }
 
-       if ( ! ngeoms ) return lwcollection_construct_empty(COLLECTIONTYPE, coll->srid, 0, 0);
+       if ( ! ngeoms ) return lwcollection_construct_empty(coll->type, coll->srid, 0, 0);
 
        return lwcollection_construct(coll->type, coll->srid,
                                      NULL, ngeoms, geoms);
index 4f4c24bbc4a1a34318e84e98ce8fe93b112dce25..5eac147fc74b8f49405e0425edce7865181f26db 100644 (file)
@@ -628,5 +628,8 @@ WITH inp AS ( SELECT
  'POINT(-176 -22)'::geography as p
 ) SELECT '#1596', ST_Summary(ST_Intersection(a,p)) FROM inp;
 
+-- #1695
+SELECT '#1695', ST_AsEWKT(ST_SnapToGrid('MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0)))'::geometry, 20));
+
 -- Clean up
 DELETE FROM spatial_ref_sys;
index 4bd17f2372e2187760b42aa9284edf836355bfab..7a5d15c6a893c878643c45d1d9d8c16efbe82e7c 100644 (file)
@@ -209,3 +209,4 @@ NOTICE:  SRID value -1 converted to the officially unknown SRID value 0
 #1596.6|public.road_pg.roads_geom SRID changed to 0
 #1596.7|0
 #1596|Point[BG]
+#1695|MULTIPOLYGON EMPTY