We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8457d0b commit 423f69aCopy full SHA for 423f69a
src/backend/utils/adt/geo_ops.c
@@ -5191,7 +5191,7 @@ poly_circle(PG_FUNCTION_ARGS)
5191
CIRCLE *circle;
5192
int i;
5193
5194
- if (poly->npts < 2)
+ if (poly->npts < 1)
5195
ereport(ERROR,
5196
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
5197
errmsg("cannot convert empty polygon to circle")));
@@ -5214,11 +5214,6 @@ poly_circle(PG_FUNCTION_ARGS)
5214
circle->radius += point_dt(&poly->p[i], &circle->center);
5215
circle->radius /= poly->npts;
5216
5217
- if (FPzero(circle->radius))
5218
- ereport(ERROR,
5219
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
5220
- errmsg("cannot convert empty polygon to circle")));
5221
-
5222
PG_RETURN_CIRCLE_P(circle);
5223
}
5224
0 commit comments