From: Paul Ramsey Date: Tue, 29 Sep 2015 17:30:28 +0000 (+0000) Subject: #3300, Box3D for curves calculation fix X-Git-Tag: 2.2.0~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=24364cc3a9663839b4380744b87f90eb43051753;p=postgis #3300, Box3D for curves calculation fix git-svn-id: http://svn.osgeo.org/postgis/trunk@14136 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/g_box.c b/liblwgeom/g_box.c index 3269ac3b5..f3f9bd75b 100644 --- a/liblwgeom/g_box.c +++ b/liblwgeom/g_box.c @@ -567,7 +567,7 @@ static int lwcircstring_calculate_gbox_cartesian(LWCIRCSTRING *curve, GBOX *gbox /* Initialize */ gbox->xmin = gbox->ymin = gbox->zmin = gbox->mmin = FLT_MAX; - gbox->xmax = gbox->ymax = gbox->zmax = gbox->mmax = FLT_MIN; + gbox->xmax = gbox->ymax = gbox->zmax = gbox->mmax = -1*FLT_MAX; for ( i = 2; i < curve->points->npoints; i += 2 ) { diff --git a/regress/tickets.sql b/regress/tickets.sql index 26165ba53..7b9a9169e 100644 --- a/regress/tickets.sql +++ b/regress/tickets.sql @@ -911,5 +911,7 @@ SELECT '#3172', ST_AsText(ST_AddMeasure('LINESTRING(0 0,0 0)', 1, 2)); --SELECT '#3244a', ST_AsText(ST_3DClosestPoint('POINT(0 0 0)', 'POINT(0 0)')); --SELECT '#3244b', ST_AsText(ST_3DClosestPoint('POINT(0 0)', 'POINT(0 0 0)')); +SELECT '#3300', ST_AsText(ST_SnapToGrid(Box2D('CURVEPOLYGON(CIRCULARSTRING(-71.0821 42.3036,-71.4821 42.3036,-71.7821 42.7036,-71.0821 42.7036,-71.0821 42.3036),(-71.1821 42.4036,-71.3821 42.6036,-71.3821 42.4036,-71.1821 42.4036))'::Geometry)::geometry,0.0001)); + -- Clean up DELETE FROM spatial_ref_sys; diff --git a/regress/tickets_expected b/regress/tickets_expected index c67fbcd13..1eddf502d 100644 --- a/regress/tickets_expected +++ b/regress/tickets_expected @@ -276,3 +276,4 @@ ERROR: invalid GML representation #2870|Point[GS] #2956|t #3172|LINESTRING M (0 0 1,0 0 2) +#3300|POLYGON((-71.7821 42.2622,-71.7821 42.9067,-71.029 42.9067,-71.029 42.2622,-71.7821 42.2622))