]> granicus.if.org Git - postgis/commitdiff
#3300, Box3D for curves calculation fix
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 29 Sep 2015 17:30:28 +0000 (17:30 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 29 Sep 2015 17:30:28 +0000 (17:30 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@14136 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/g_box.c
regress/tickets.sql
regress/tickets_expected

index 3269ac3b578cd6fa207f6818663e7670bfa80946..f3f9bd75bdcdd41debfd275b4b7c442f04632939 100644 (file)
@@ -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 )
        {
index 26165ba53915d68640420943471c08fed63cf988..7b9a9169ee58efe8c4f1ea88fcaf9387b3c62265 100644 (file)
@@ -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;
index c67fbcd13d2ddab4fc35eeced8c865b8b752747a..1eddf502dc7c41494a661c7a8bc75d438aba128b 100644 (file)
@@ -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))