mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-24 09:02:37 +00:00
Return empty geoms snapped to a grid as immutated (#1089)
Also introduces an "empty" regression test git-svn-id: http://svn.osgeo.org/postgis/trunk@8408 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
parent
da780f4405
commit
ed841457ad
|
@ -530,8 +530,8 @@ Datum LWGEOM_snaptogrid(PG_FUNCTION_ARGS)
|
|||
/* Do not support gridding Z and M values for now */
|
||||
grid.ipz=grid.ipm=grid.zsize=grid.msize=0;
|
||||
|
||||
/* Return input geometry if grid is null */
|
||||
if ( grid_isNull(&grid) )
|
||||
/* Return input geometry if grid is null or input geometry is empty */
|
||||
if ( grid_isNull(&grid) || gserialized_is_empty(in_geom) )
|
||||
{
|
||||
PG_RETURN_POINTER(in_geom);
|
||||
}
|
||||
|
|
|
@ -58,6 +58,7 @@ TESTS = \
|
|||
snaptogrid \
|
||||
summary \
|
||||
affine \
|
||||
empty \
|
||||
measures \
|
||||
long_xact \
|
||||
ctors \
|
||||
|
|
3
regress/empty.sql
Normal file
3
regress/empty.sql
Normal file
|
@ -0,0 +1,3 @@
|
|||
SELECT 'T1.1', ST_AsEWKT(ST_SnapToGrid('POINT EMPTY', 1));
|
||||
SELECT 'T1.2', ST_AsEWKT(ST_SnapToGrid('LINESTRING EMPTY', 1));
|
||||
SELECT 'T1.3', ST_AsEWKT(ST_SnapToGrid('SRID=4326;POLYGON EMPTY', 1));
|
3
regress/empty_expected
Normal file
3
regress/empty_expected
Normal file
|
@ -0,0 +1,3 @@
|
|||
T1.1|POINT EMPTY
|
||||
T1.2|LINESTRING EMPTY
|
||||
T1.3|SRID=4326;POLYGON EMPTY
|
Loading…
Reference in a new issue