Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit423f69a

Browse files
committed
Allow single-point polygons to be converted to circles
This allows finding the center of a single-point polygon and convertingit to a point.Per report from Josef Grahn
1 parent8457d0b commit423f69a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

‎src/backend/utils/adt/geo_ops.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5191,7 +5191,7 @@ poly_circle(PG_FUNCTION_ARGS)
51915191
CIRCLE*circle;
51925192
inti;
51935193

5194-
if (poly->npts<2)
5194+
if (poly->npts<1)
51955195
ereport(ERROR,
51965196
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
51975197
errmsg("cannot convert empty polygon to circle")));
@@ -5214,11 +5214,6 @@ poly_circle(PG_FUNCTION_ARGS)
52145214
circle->radius+=point_dt(&poly->p[i],&circle->center);
52155215
circle->radius /=poly->npts;
52165216

5217-
if (FPzero(circle->radius))
5218-
ereport(ERROR,
5219-
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
5220-
errmsg("cannot convert empty polygon to circle")));
5221-
52225217
PG_RETURN_CIRCLE_P(circle);
52235218
}
52245219

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp