ST_SnapToGrid: retain type on empty return (#1695)

git-svn-id: http://svn.osgeo.org/postgis/trunk@9516 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Sandro Santilli 2012-03-19 12:07:39 +00:00
parent f57a0f7c2e
commit e8263f6807
3 changed files with 5 additions and 1 deletions

View 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);

View 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;

View 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