From: Nicklas Avén Date: Fri, 23 Mar 2018 14:57:29 +0000 (+0000) Subject: Fix error message in ST_ChaikinSmoothing per request X-Git-Tag: 2.5.0alpha~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=648feba405c3c0edd2515f6fd90d576d8cfb9c9f;p=postgis Fix error message in ST_ChaikinSmoothing per request git-svn-id: http://svn.osgeo.org/postgis/trunk@16488 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/lwgeom_functions_analytic.c b/postgis/lwgeom_functions_analytic.c index 18dde2a11..fca1f93e2 100644 --- a/postgis/lwgeom_functions_analytic.c +++ b/postgis/lwgeom_functions_analytic.c @@ -144,10 +144,8 @@ Datum LWGEOM_ChaikinSmoothing(PG_FUNCTION_ARGS) if ( (PG_NARGS()>1) && (!PG_ARGISNULL(1)) ) n_iterations = PG_GETARG_INT32(1); - if (n_iterations>5) - elog(ERROR,"Not more than 5 iterations please"); - if (n_iterations< 1) - elog(ERROR,"Number of iterations must be between 1 and 5"); + if (n_iterations< 1 || n_iterations>5) + elog(ERROR,"Number of iterations must be between 1 and 5 : %s", __func__); if ( (PG_NARGS()>2) && (!PG_ARGISNULL(2)) ) { diff --git a/regress/chaikin_expected b/regress/chaikin_expected index 737d6b7bf..b4d19f2f2 100644 --- a/regress/chaikin_expected +++ b/regress/chaikin_expected @@ -1,6 +1,6 @@ 1|LINESTRING(0 0,6 6,6 10,0 16) -ERROR: Not more than 5 iterations please -ERROR: Number of iterations must be between 1 and 5 +ERROR: Number of iterations must be between 1 and 5 : LWGEOM_ChaikinSmoothing +ERROR: Number of iterations must be between 1 and 5 : LWGEOM_ChaikinSmoothing 4|LINESTRING(0 0,4.5 4.5,6 7,6 9,4.5 11.5,0 16) 5|POINT(0 0) 6|GEOMETRYCOLLECTION(POINT(1 1),LINESTRING(1 1,1 2.125,1 2.75,1 3.25,1 3.875,1 5),POLYGON((5 5,5 7.8125,5.3125 9.0625,5.9375 9.6875,6.875 10,8.125 10,9.0625 9.6875,9.6875 9.0625,10 8.125,10 6.875,9.6875 5.9375,9.0625 5.3125,7.8125 5,5 5),(6 6,6 6.5625,6.0625 6.8125,6.1875 6.9375,6.375 7,6.625 7,6.8125 6.9375,6.9375 6.8125,7 6.625,7 6.375,6.9375 6.1875,6.8125 6.0625,6.5625 6,6 6)))