Commit 7f96a134 authored by Dan Baston's avatar Dan Baston

Preserve SRID in ST_Expand

git-svn-id: http://svn.osgeo.org/postgis/trunk@14931 b70326c6-7e19-0410-871a-916f4a2858ee
parent abdec02e
Pipeline #3447317 passed with stage
in 19 minutes and 5 seconds
......@@ -1564,6 +1564,7 @@ Datum LWGEOM_expand(PG_FUNCTION_ARGS)
{
GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
int srid = lwgeom_get_srid(lwgeom);
LWPOLY *poly;
GSERIALIZED *result;
GBOX gbox;
......@@ -1610,6 +1611,7 @@ Datum LWGEOM_expand(PG_FUNCTION_ARGS)
}
lwgeom_add_bbox(lwpoly_as_lwgeom(poly));
lwgeom_set_srid(lwpoly_as_lwgeom(poly), srid);
/* Construct GSERIALIZED */
result = geometry_serialize(lwpoly_as_lwgeom(poly));
......
......@@ -276,6 +276,7 @@ select '222', ST_Expand(null::box3d, 1, 1, 1);
select '223', ST_Expand('BOX3D(-1 3 5, -1 6 8)'::BOX3D, 1, -1, 7);
select '224', ST_Expand(null::box2d, 1, 1);
select '225', ST_Expand('BOX(-2 3, -1 6'::BOX2D, 4, 2);
select '226', ST_SRID(ST_Expand('SRID=4326;POINT (0 0)'::geometry, 1))=4326;
-- Drop test table
DROP table test;
......@@ -199,3 +199,4 @@ ERROR: geometry contains non-closed rings
223|BOX3D(-2 4 -2,0 5 15)
224|
225|BOX(-6 1,3 8)
226|t
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment