36#include "utils/fmgrprotos.h"
136 const char *type_name,
const char *orig_string,
140 const char *type_name,
const char *orig_string,
145 bool *isopen,
char **endptr_p,
146 const char *type_name,
const char *orig_string,
195 const char *type_name,
const char *orig_string,
213 const char *type_name,
const char *orig_string,
218 while (isspace((
unsigned char) *
str))
236 while (isspace((
unsigned char) *
str))
243 else if (*
str !=
'\0')
249 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
250 errmsg(
"invalid input syntax for type %s: \"%s\"",
251 type_name, orig_string)));
267 bool *isopen,
char **endptr_p,
268 const char *type_name,
const char *orig_string,
275 while (isspace((
unsigned char) *
str))
288 while (isspace((
unsigned char) *cp))
302 for (
i = 0;
i < npts;
i++)
318 while (isspace((
unsigned char) *
str))
328 else if (*
str !=
'\0')
334 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
335 errmsg(
"invalid input syntax for type %s: \"%s\"",
336 type_name, orig_string)));
359 for (
i = 0;
i < npts;
i++)
396 while ((s = strchr(s, delim)) != NULL)
401 return (ndelim % 2) ? ((ndelim + 1) / 2) : -1;
425 Node *escontext = fcinfo->context;
523 result->
low.
x = pt2->
x;
528 result->
low.
x = pt1->
x;
533 result->
low.
y = pt2->
y;
538 result->
low.
y = pt1->
y;
965 while (isspace((
unsigned char) *s))
973 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
974 errmsg(
"invalid input syntax for type %s: \"%s\"",
982 Node *escontext = fcinfo->context;
989 while (isspace((
unsigned char) *s))
997 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
998 errmsg(
"invalid line specification: A and B cannot both be zero")));
1007 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
1008 errmsg(
"invalid line specification: must be two distinct points")));
1051 (
errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
1052 errmsg(
"invalid line specification: A and B cannot both be zero")));
1106 if (result->
C == 0.0)
1123 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1124 errmsg(
"invalid line specification: must be two distinct points")));
1201 if (
unlikely(isnan(l1->
A) || isnan(l1->
B) || isnan(l1->
C) ||
1202 isnan(l2->
A) || isnan(l2->
B) || isnan(l2->
C)))
1272 else if (!
FPzero(l1->
B) && !isnan(l1->
B) && !
FPzero(l2->
B) && !isnan(l2->
B))
1390 for (
i = 0;
i < path->
npts;
i++)
1392 j = (
i + 1) % path->
npts;
1405 Node *escontext = fcinfo->context;
1416 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
1417 errmsg(
"invalid input syntax for type %s: \"%s\"",
1421 while (isspace((
unsigned char) *s))
1431 base_size =
sizeof(path->
p[0]) * npts;
1432 size = offsetof(
PATH, p) + base_size;
1435 if (base_size / npts !=
sizeof(path->
p[0]) ||
size <= base_size)
1437 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
1438 errmsg(
"too many points requested")));
1445 if (!
path_decode(s,
true, npts, &(path->
p[0]), &isopen, &s,
"path",
str,
1453 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
1454 errmsg(
"invalid input syntax for type %s: \"%s\"",
1456 while (isspace((
unsigned char) *s))
1461 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
1462 errmsg(
"invalid input syntax for type %s: \"%s\"",
1465 path->
closed = (!isopen);
1499 if (npts <= 0 || npts >= (
int32) ((INT_MAX - offsetof(
PATH, p)) /
sizeof(
Point)))
1501 (
errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
1502 errmsg(
"invalid number of points in external \"path\" value")));
1504 size = offsetof(
PATH, p) +
sizeof(path->
p[0]) * npts;
1509 path->
closed = (closed ? 1 : 0);
1513 for (
i = 0;
i < npts;
i++)
1535 for (
i = 0;
i < path->
npts;
i++)
1668 for (
i = 1;
i < p1->
npts;
i++)
1677 for (
i = 1;
i <
p2->npts;
i++)
1688 for (
i = 0;
i < p1->
npts;
i++)
1698 iprev = p1->
npts - 1;
1701 for (
j = 0;
j <
p2->npts;
j++)
1711 jprev =
p2->npts - 1;
1735 bool have_min =
false;
1742 for (
i = 0;
i < p1->
npts;
i++)
1752 iprev = p1->
npts - 1;
1755 for (
j = 0;
j <
p2->npts;
j++)
1765 jprev =
p2->npts - 1;
1798 for (
i = 0;
i < path->
npts;
i++)
1808 iprev = path->
npts - 1;
1980 if (
unlikely(isnan(pt1->
x) || isnan(pt1->
y) ||
1981 isnan(pt2->
x) || isnan(pt2->
y)))
2025 if (
FPeq(pt1->
x, pt2->
x))
2027 if (
FPeq(pt1->
y, pt2->
y))
2041 if (
FPeq(pt1->
x, pt2->
x))
2043 if (
FPeq(pt1->
y, pt2->
y))
2068 Node *escontext = fcinfo->context;
2144 lseg->
p[0].
x = pt1->
x;
2145 lseg->
p[0].
y = pt1->
y;
2146 lseg->
p[1].
x = pt2->
x;
2147 lseg->
p[1].
y = pt2->
y;
2438 bool have_min =
false;
2449 for (
i = 0;
i < path->
npts;
i++)
2459 iprev = path->
npts - 1;
2464 if (!have_min ||
float8_lt(tmp, result))
2641 seg.
p[0].
x = poly->
p[0].
x;
2642 seg.
p[0].
y = poly->
p[0].
y;
2643 seg.
p[1].
x = poly->
p[poly->
npts - 1].
x;
2644 seg.
p[1].
y = poly->
p[poly->
npts - 1].
y;
2648 for (
i = 0;
i < poly->
npts - 1;
i++)
2650 seg.
p[0].
x = poly->
p[
i].
x;
2651 seg.
p[0].
y = poly->
p[
i].
y;
2652 seg.
p[1].
x = poly->
p[
i + 1].
x;
2653 seg.
p[1].
y = poly->
p[
i + 1].
y;
2703 *result = lseg->
p[0];
2705 *result = lseg->
p[1];
2839 *result = on_lseg->
p[0];
2846 *result = on_lseg->
p[1];
2895 point.
x = box->
low.
x;
2910 point.
y = box->
low.
y;
2974 *result = lseg->
p[0];
2981 *result = lseg->
p[1];
3025 point.
x = box->
low.
x;
3040 point.
y = box->
low.
y;
3132 return box->
high.
x >= point->
x && box->
low.
x <= point->
x &&
3133 box->
high.
y >= point->
y && box->
low.
y <= point->
y;
3180 for (
i = 0;
i < n;
i++)
3290 point.
x = box->
low.
x;
3301 point.
y = box->
low.
y;
3386 x1 = x2 = poly->
p[0].
x;
3387 y2 = y1 = poly->
p[0].
y;
3388 for (
i = 1;
i < poly->
npts;
i++)
3418 Node *escontext = fcinfo->context;
3427 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
3428 errmsg(
"invalid input syntax for type %s: \"%s\"",
3431 base_size =
sizeof(poly->
p[0]) * npts;
3435 if (base_size / npts !=
sizeof(poly->
p[0]) ||
size <= base_size)
3437 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
3438 errmsg(
"too many points requested")));
3445 if (!
path_decode(
str,
false, npts, &(poly->
p[0]), &isopen, NULL,
"polygon",
3484 if (npts <= 0 || npts >= (
int32) ((INT_MAX - offsetof(
POLYGON, p)) /
sizeof(
Point)))
3486 (
errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
3487 errmsg(
"invalid number of points in external \"polygon\" value")));
3489 size = offsetof(
POLYGON, p) +
sizeof(poly->
p[0]) * npts;
3495 for (
i = 0;
i < npts;
i++)
3518 for (
i = 0;
i < poly->
npts;
i++)
3766 sa.p[0] = polya->
p[polya->
npts - 1];
3769 for (ia = 0; ia < polya->
npts && !result; ia++)
3772 sa.p[1] = polya->
p[ia];
3775 sb.
p[0] = polyb->
p[polyb->
npts - 1];
3777 for (ib = 0; ib < polyb->
npts && !result; ib++)
3779 sb.
p[1] = polyb->
p[ib];
3872 intersection =
false;
3887 s.
p[1] = poly->
p[
i];
3908 intersection =
true;
3917 if (
res && !intersection)
3952 s.
p[0] = contained_poly->
p[contained_poly->
npts - 1];
3954 for (
i = 0;
i < contained_poly->
npts;
i++)
3956 s.
p[1] = contained_poly->
p[
i];
4032 bool have_min =
false;
4052 for (
i = 0;
i < polya->
npts;
i++)
4059 iprev = polya->
npts - 1;
4061 for (
j = 0;
j < polyb->
npts;
j++)
4068 jprev = polyb->
npts - 1;
4360 base_size =
sizeof(p1->
p[0]) * (p1->
npts +
p2->npts);
4361 size = offsetof(
PATH, p) + base_size;
4364 if (base_size /
sizeof(p1->
p[0]) != (p1->
npts +
p2->npts) ||
4367 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
4368 errmsg(
"too many points requested")));
4378 for (
i = 0;
i < p1->
npts;
i++)
4380 result->
p[
i].
x = p1->
p[
i].
x;
4381 result->
p[
i].
y = p1->
p[
i].
y;
4383 for (
i = 0;
i <
p2->npts;
i++)
4402 for (
i = 0;
i < path->
npts;
i++)
4415 for (
i = 0;
i < path->
npts;
i++)
4431 for (
i = 0;
i < path->
npts;
i++)
4444 for (
i = 0;
i < path->
npts;
i++)
4462 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
4463 errmsg(
"open path cannot be converted to polygon")));
4475 for (
i = 0;
i < path->
npts;
i++)
4477 poly->
p[
i].
x = path->
p[
i].
x;
4478 poly->
p[
i].
y = path->
p[
i].
y;
4548 poly->
p[0].
x = box->
low.
x;
4549 poly->
p[0].
y = box->
low.
y;
4550 poly->
p[1].
x = box->
low.
x;
4555 poly->
p[3].
y = box->
low.
y;
4584 for (
i = 0;
i < poly->
npts;
i++)
4586 path->
p[
i].
x = poly->
p[
i].
x;
4587 path->
p[
i].
y = poly->
p[
i].
y;
4614 Node *escontext = fcinfo->context;
4621 while (isspace((
unsigned char) *s))
4629 while (isspace((
unsigned char) *cp))
4647 if (circle->
radius < 0.0)
4649 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
4650 errmsg(
"invalid input syntax for type %s: \"%s\"",
4659 while (isspace((
unsigned char) *s))
4664 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
4665 errmsg(
"invalid input syntax for type %s: \"%s\"",
4671 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
4672 errmsg(
"invalid input syntax for type %s: \"%s\"",
4715 if (circle->
radius < 0.0)
4717 (
errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
4718 errmsg(
"invalid radius in external \"circle\" value")));
5238 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
5239 errmsg(
"cannot convert circle with radius zero to polygon")));
5243 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
5244 errmsg(
"must request at least 2 points")));
5246 base_size =
sizeof(poly->
p[0]) * npts;
5250 if (base_size / npts !=
sizeof(poly->
p[0]) ||
size <= base_size)
5252 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
5253 errmsg(
"too many points requested")));
5261 for (
i = 0;
i < npts;
i++)
5295 for (
i = 0;
i < poly->
npts;
i++)
5300 for (
i = 0;
i < poly->
npts;
i++)
5337#define POINT_ON_POLYGON INT_MAX
5361 for (
i = 1;
i < npts;
i++)
5370 total_cross += cross;
5379 total_cross += cross;
5381 if (total_cross != 0)
5406 else if (
FPgt(
x, 0))
5411 return FPlt(prev_y, 0.0) ? 1 : -1;
5424 y_sign =
FPgt(
y, 0.0) ? 1 : -1;
5428 return FPlt(prev_x, 0.0) ? 0 : y_sign;
5429 else if ((y_sign < 0 &&
FPlt(prev_y, 0.0)) ||
5430 (y_sign > 0 &&
FPgt(prev_y, 0.0)))
5447 if ((y_sign < 0 &&
FPlt(z, 0.0)) ||
5448 (y_sign > 0 &&
FPgt(z, 0.0)))
5464 for (
i = 0;
i < npts;
i++)
5470 for (ii = 1,
j =
i + 1; ii < npts; ii++,
j++)
5481 for (ii = 1,
j =
i - 1; ii < npts; ii++,
j--)
5525 if (isinf(
x) || isinf(
y))
5528 if (isnan(
x) || isnan(
y))
5554 result =
x * sqrt(1.0 + (yx * yx));
#define Assert(condition)
static void PGresult const char * p2
static void PGresult * res
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereturn(context, dummy_value,...)
#define ereport(elevel,...)
float8 float8in_internal(char *num, char **endptr_p, const char *type_name, const char *orig_string, struct Node *escontext)
pg_noinline void float_overflow_error(void)
pg_noinline void float_underflow_error(void)
char * float8out_internal(double num)
static float8 float8_min(const float8 val1, const float8 val2)
static float8 float8_mul(const float8 val1, const float8 val2)
static float8 float8_pl(const float8 val1, const float8 val2)
static float8 float8_mi(const float8 val1, const float8 val2)
static float8 get_float8_infinity(void)
static float8 float8_max(const float8 val1, const float8 val2)
static bool float8_eq(const float8 val1, const float8 val2)
static float8 get_float8_nan(void)
static float8 float8_div(const float8 val1, const float8 val2)
static bool float8_lt(const float8 val1, const float8 val2)
static bool float8_gt(const float8 val1, const float8 val2)
#define PG_FREE_IF_COPY(ptr, n)
#define PG_RETURN_BYTEA_P(x)
#define PG_GETARG_FLOAT8(n)
#define PG_RETURN_FLOAT8(x)
#define PG_GETARG_POINTER(n)
#define PG_RETURN_CSTRING(x)
#define PG_GETARG_CSTRING(n)
#define PG_RETURN_INT32(x)
#define PG_GETARG_INT32(n)
#define PG_RETURN_BOOL(x)
static bool FPlt(double A, double B)
#define PG_GETARG_POINT_P(n)
#define PG_RETURN_CIRCLE_P(x)
static bool FPge(double A, double B)
#define PG_RETURN_BOX_P(x)
#define PG_RETURN_LSEG_P(x)
#define PG_RETURN_POINT_P(x)
#define PG_GETARG_LINE_P(n)
static bool FPne(double A, double B)
#define PG_RETURN_POLYGON_P(x)
#define PG_GETARG_BOX_P(n)
#define PG_GETARG_POLYGON_P(n)
#define PG_GETARG_PATH_P_COPY(n)
#define PG_GETARG_CIRCLE_P(n)
static bool FPgt(double A, double B)
static bool FPle(double A, double B)
#define PG_GETARG_LSEG_P(n)
#define PG_RETURN_LINE_P(x)
#define PG_GETARG_PATH_P(n)
static bool FPeq(double A, double B)
#define PG_RETURN_PATH_P(x)
static void poly_to_circle(CIRCLE *result, POLYGON *poly)
Datum circle_div_pt(PG_FUNCTION_ARGS)
static bool pair_decode(char *str, float8 *x, float8 *y, char **endptr_p, const char *type_name, const char *orig_string, Node *escontext)
Datum circle_contained(PG_FUNCTION_ARGS)
Datum close_ls(PG_FUNCTION_ARGS)
static bool box_ov(BOX *box1, BOX *box2)
static float8 box_closept_point(Point *result, BOX *box, Point *pt)
Datum box_width(PG_FUNCTION_ARGS)
Datum path_n_le(PG_FUNCTION_ARGS)
Datum lseg_center(PG_FUNCTION_ARGS)
Datum path_close(PG_FUNCTION_ARGS)
Datum circle_in(PG_FUNCTION_ARGS)
Datum point_distance(PG_FUNCTION_ARGS)
static int lseg_crossing(float8 x, float8 y, float8 prev_x, float8 prev_y)
Datum circle_eq(PG_FUNCTION_ARGS)
Datum path_distance(PG_FUNCTION_ARGS)
static bool box_interpt_lseg(Point *result, BOX *box, LSEG *lseg)
static bool lseg_inside_poly(Point *a, Point *b, POLYGON *poly, int start)
static bool lseg_contain_point(LSEG *lseg, Point *pt)
Datum lseg_send(PG_FUNCTION_ARGS)
Datum box_left(PG_FUNCTION_ARGS)
static bool single_decode(char *num, float8 *x, char **endptr_p, const char *type_name, const char *orig_string, Node *escontext)
Datum point_ne(PG_FUNCTION_ARGS)
Datum path_n_eq(PG_FUNCTION_ARGS)
Datum point_out(PG_FUNCTION_ARGS)
Datum circle_overright(PG_FUNCTION_ARGS)
Datum circle_radius(PG_FUNCTION_ARGS)
Datum cr_circle(PG_FUNCTION_ARGS)
static char * path_encode(enum path_delim path_delim, int npts, Point *pt)
Datum point_send(PG_FUNCTION_ARGS)
Datum circle_distance(PG_FUNCTION_ARGS)
Datum circle_center(PG_FUNCTION_ARGS)
Datum box_gt(PG_FUNCTION_ARGS)
Datum circle_right(PG_FUNCTION_ARGS)
Datum circle_overleft(PG_FUNCTION_ARGS)
Datum path_mul_pt(PG_FUNCTION_ARGS)
Datum box_right(PG_FUNCTION_ARGS)
static float8 box_ht(BOX *box)
Datum dist_pathp(PG_FUNCTION_ARGS)
Datum circle_diameter(PG_FUNCTION_ARGS)
static bool poly_contain_poly(POLYGON *contains_poly, POLYGON *contained_poly)
Datum lseg_out(PG_FUNCTION_ARGS)
Datum path_n_ge(PG_FUNCTION_ARGS)
Datum box_ge(PG_FUNCTION_ARGS)
Datum poly_in(PG_FUNCTION_ARGS)
Datum dist_pc(PG_FUNCTION_ARGS)
Datum point_sub(PG_FUNCTION_ARGS)
Datum poly_npoints(PG_FUNCTION_ARGS)
Datum dist_ps(PG_FUNCTION_ARGS)
Datum poly_overabove(PG_FUNCTION_ARGS)
static void statlseg_construct(LSEG *lseg, Point *pt1, Point *pt2)
Datum on_pl(PG_FUNCTION_ARGS)
Datum path_isopen(PG_FUNCTION_ARGS)
Datum path_sub_pt(PG_FUNCTION_ARGS)
Datum circle_same(PG_FUNCTION_ARGS)
Datum point_div(PG_FUNCTION_ARGS)
Datum line_vertical(PG_FUNCTION_ARGS)
Datum box_same(PG_FUNCTION_ARGS)
Datum line_in(PG_FUNCTION_ARGS)
Datum circle_box(PG_FUNCTION_ARGS)
static void point_construct(Point *result, float8 x, float8 y)
Datum circle_ge(PG_FUNCTION_ARGS)
Datum poly_contain_pt(PG_FUNCTION_ARGS)
Datum dist_ppoly(PG_FUNCTION_ARGS)
Datum poly_out(PG_FUNCTION_ARGS)
Datum poly_distance(PG_FUNCTION_ARGS)
Datum line_distance(PG_FUNCTION_ARGS)
Datum circle_mul_pt(PG_FUNCTION_ARGS)
Datum point_eq(PG_FUNCTION_ARGS)
static bool box_contain_box(BOX *contains_box, BOX *contained_box)
Datum dist_ppath(PG_FUNCTION_ARGS)
Datum point_box(PG_FUNCTION_ARGS)
static void line_construct(LINE *result, Point *pt, float8 m)
Datum box_sub(PG_FUNCTION_ARGS)
Datum circle_overabove(PG_FUNCTION_ARGS)
Datum poly_overright(PG_FUNCTION_ARGS)
Datum point_above(PG_FUNCTION_ARGS)
Datum dist_cpoly(PG_FUNCTION_ARGS)
Datum line_perp(PG_FUNCTION_ARGS)
Datum path_in(PG_FUNCTION_ARGS)
Datum dist_pl(PG_FUNCTION_ARGS)
static void point_add_point(Point *result, Point *pt1, Point *pt2)
Datum lseg_eq(PG_FUNCTION_ARGS)
Datum poly_contained(PG_FUNCTION_ARGS)
Datum poly_circle(PG_FUNCTION_ARGS)
Datum box_distance(PG_FUNCTION_ARGS)
Datum close_lseg(PG_FUNCTION_ARGS)
Datum path_area(PG_FUNCTION_ARGS)
Datum points_box(PG_FUNCTION_ARGS)
Datum box_below(PG_FUNCTION_ARGS)
static void make_bound_box(POLYGON *poly)
Datum poly_overleft(PG_FUNCTION_ARGS)
static bool line_decode(char *s, const char *str, LINE *line, Node *escontext)
Datum poly_path(PG_FUNCTION_ARGS)
static float8 box_closept_lseg(Point *result, BOX *box, LSEG *lseg)
static void point_mul_point(Point *result, Point *pt1, Point *pt2)
Datum circle_above(PG_FUNCTION_ARGS)
Datum dist_sp(PG_FUNCTION_ARGS)
Datum poly_overlap(PG_FUNCTION_ARGS)
Datum lseg_ge(PG_FUNCTION_ARGS)
Datum poly_left(PG_FUNCTION_ARGS)
Datum line_construct_pp(PG_FUNCTION_ARGS)
static bool poly_overlap_internal(POLYGON *polya, POLYGON *polyb)
static float8 circle_ar(CIRCLE *circle)
Datum path_open(PG_FUNCTION_ARGS)
Datum box_add(PG_FUNCTION_ARGS)
Datum box_diagonal(PG_FUNCTION_ARGS)
Datum line_eq(PG_FUNCTION_ARGS)
Datum box_below_eq(PG_FUNCTION_ARGS)
static void box_cn(Point *center, BOX *box)
Datum path_send(PG_FUNCTION_ARGS)
Datum poly_contain(PG_FUNCTION_ARGS)
Datum circle_add_pt(PG_FUNCTION_ARGS)
static void point_div_point(Point *result, Point *pt1, Point *pt2)
static float8 box_ar(BOX *box)
Datum poly_recv(PG_FUNCTION_ARGS)
Datum inter_lb(PG_FUNCTION_ARGS)
Datum box_area(PG_FUNCTION_ARGS)
Datum path_length(PG_FUNCTION_ARGS)
Datum boxes_bound_box(PG_FUNCTION_ARGS)
Datum box_out(PG_FUNCTION_ARGS)
Datum circle_below(PG_FUNCTION_ARGS)
Datum lseg_gt(PG_FUNCTION_ARGS)
static float8 lseg_closept_point(Point *result, LSEG *lseg, Point *pt)
Datum path_out(PG_FUNCTION_ARGS)
Datum box_in(PG_FUNCTION_ARGS)
Datum box_recv(PG_FUNCTION_ARGS)
static float8 lseg_closept_line(Point *result, LSEG *lseg, LINE *line)
Datum on_ppath(PG_FUNCTION_ARGS)
Datum pt_contained_circle(PG_FUNCTION_ARGS)
Datum lseg_recv(PG_FUNCTION_ARGS)
Datum line_send(PG_FUNCTION_ARGS)
Datum lseg_horizontal(PG_FUNCTION_ARGS)
Datum close_pl(PG_FUNCTION_ARGS)
static float8 line_closept_point(Point *result, LINE *line, Point *point)
Datum box_above_eq(PG_FUNCTION_ARGS)
Datum on_ps(PG_FUNCTION_ARGS)
Datum box_contain_pt(PG_FUNCTION_ARGS)
Datum dist_sl(PG_FUNCTION_ARGS)
Datum path_poly(PG_FUNCTION_ARGS)
Datum point_below(PG_FUNCTION_ARGS)
Datum box_le(PG_FUNCTION_ARGS)
Datum line_parallel(PG_FUNCTION_ARGS)
Datum lseg_length(PG_FUNCTION_ARGS)
float8 pg_hypot(float8 x, float8 y)
Datum line_out(PG_FUNCTION_ARGS)
Datum line_interpt(PG_FUNCTION_ARGS)
Datum close_sb(PG_FUNCTION_ARGS)
Datum lseg_le(PG_FUNCTION_ARGS)
Datum on_pb(PG_FUNCTION_ARGS)
static int point_inside(Point *p, int npts, Point *plist)
Datum lseg_ne(PG_FUNCTION_ARGS)
Datum path_inter(PG_FUNCTION_ARGS)
Datum dist_lp(PG_FUNCTION_ARGS)
Datum box_poly(PG_FUNCTION_ARGS)
Datum inter_sb(PG_FUNCTION_ARGS)
Datum poly_below(PG_FUNCTION_ARGS)
Datum poly_overbelow(PG_FUNCTION_ARGS)
Datum pt_contained_poly(PG_FUNCTION_ARGS)
Datum circle_contain(PG_FUNCTION_ARGS)
static bool line_interpt_line(Point *result, LINE *l1, LINE *l2)
static void box_construct(BOX *result, Point *pt1, Point *pt2)
Datum lseg_lt(PG_FUNCTION_ARGS)
Datum circle_send(PG_FUNCTION_ARGS)
static bool box_contain_lseg(BOX *box, LSEG *lseg)
Datum circle_lt(PG_FUNCTION_ARGS)
Datum lseg_vertical(PG_FUNCTION_ARGS)
Datum lseg_construct(PG_FUNCTION_ARGS)
Datum lseg_intersect(PG_FUNCTION_ARGS)
Datum dist_bp(PG_FUNCTION_ARGS)
Datum box_div(PG_FUNCTION_ARGS)
Datum path_n_lt(PG_FUNCTION_ARGS)
Datum box_overright(PG_FUNCTION_ARGS)
Datum path_npoints(PG_FUNCTION_ARGS)
static float8 point_dt(Point *pt1, Point *pt2)
Datum on_sl(PG_FUNCTION_ARGS)
Datum point_horiz(PG_FUNCTION_ARGS)
Datum circle_out(PG_FUNCTION_ARGS)
Datum inter_sl(PG_FUNCTION_ARGS)
static bool path_decode(char *str, bool opentype, int npts, Point *p, bool *isopen, char **endptr_p, const char *type_name, const char *orig_string, Node *escontext)
Datum lseg_parallel(PG_FUNCTION_ARGS)
static bool plist_same(int npts, Point *p1, Point *p2)
static bool touched_lseg_inside_poly(Point *a, Point *b, LSEG *s, POLYGON *poly, int start)
Datum box_overabove(PG_FUNCTION_ARGS)
Datum poly_above(PG_FUNCTION_ARGS)
Datum line_recv(PG_FUNCTION_ARGS)
Datum lseg_interpt(PG_FUNCTION_ARGS)
Datum point_recv(PG_FUNCTION_ARGS)
Datum box_circle(PG_FUNCTION_ARGS)
Datum path_isclosed(PG_FUNCTION_ARGS)
Datum circle_sub_pt(PG_FUNCTION_ARGS)
Datum line_horizontal(PG_FUNCTION_ARGS)
Datum box_mul(PG_FUNCTION_ARGS)
Datum box_overlap(PG_FUNCTION_ARGS)
Datum box_center(PG_FUNCTION_ARGS)
Datum circle_overbelow(PG_FUNCTION_ARGS)
static float8 dist_ppoly_internal(Point *pt, POLYGON *poly)
Datum box_contain(PG_FUNCTION_ARGS)
Datum box_height(PG_FUNCTION_ARGS)
Datum circle_contain_pt(PG_FUNCTION_ARGS)
Datum dist_bs(PG_FUNCTION_ARGS)
Datum path_add_pt(PG_FUNCTION_ARGS)
static float8 box_wd(BOX *box)
static bool box_contain_point(BOX *box, Point *point)
Datum circle_ne(PG_FUNCTION_ARGS)
Datum circle_le(PG_FUNCTION_ARGS)
Datum box_intersect(PG_FUNCTION_ARGS)
Datum close_pb(PG_FUNCTION_ARGS)
Datum circle_left(PG_FUNCTION_ARGS)
static float8 point_sl(Point *pt1, Point *pt2)
static float8 lseg_invsl(LSEG *lseg)
Datum point_left(PG_FUNCTION_ARGS)
Datum path_add(PG_FUNCTION_ARGS)
static bool line_contain_point(LINE *line, Point *point)
Datum circle_overlap(PG_FUNCTION_ARGS)
Datum lseg_in(PG_FUNCTION_ARGS)
Datum circle_area(PG_FUNCTION_ARGS)
Datum on_sb(PG_FUNCTION_ARGS)
Datum dist_pb(PG_FUNCTION_ARGS)
Datum point_add(PG_FUNCTION_ARGS)
static float8 lseg_sl(LSEG *lseg)
Datum circle_recv(PG_FUNCTION_ARGS)
Datum poly_right(PG_FUNCTION_ARGS)
Datum box_lt(PG_FUNCTION_ARGS)
Datum path_recv(PG_FUNCTION_ARGS)
static float8 dist_cpoly_internal(CIRCLE *circle, POLYGON *poly)
static float8 line_sl(LINE *line)
Datum line_intersect(PG_FUNCTION_ARGS)
Datum box_eq(PG_FUNCTION_ARGS)
Datum path_n_gt(PG_FUNCTION_ARGS)
Datum poly_box(PG_FUNCTION_ARGS)
Datum point_slope(PG_FUNCTION_ARGS)
Datum circle_poly(PG_FUNCTION_ARGS)
static int pair_count(char *s, char delim)
static bool lseg_interpt_lseg(Point *result, LSEG *l1, LSEG *l2)
Datum point_right(PG_FUNCTION_ARGS)
Datum box_send(PG_FUNCTION_ARGS)
static float8 point_invsl(Point *pt1, Point *pt2)
Datum point_mul(PG_FUNCTION_ARGS)
static float8 dist_ppath_internal(Point *pt, PATH *path)
static void pair_encode(float8 x, float8 y, StringInfo str)
Datum dist_polyc(PG_FUNCTION_ARGS)
Datum dist_sb(PG_FUNCTION_ARGS)
static float8 line_invsl(LINE *line)
static void point_sub_point(Point *result, Point *pt1, Point *pt2)
Datum circle_gt(PG_FUNCTION_ARGS)
Datum box_overbelow(PG_FUNCTION_ARGS)
static float8 lseg_closept_lseg(Point *result, LSEG *on_lseg, LSEG *to_lseg)
Datum dist_cpoint(PG_FUNCTION_ARGS)
Datum lseg_distance(PG_FUNCTION_ARGS)
Datum dist_ls(PG_FUNCTION_ARGS)
Datum construct_point(PG_FUNCTION_ARGS)
Datum poly_center(PG_FUNCTION_ARGS)
Datum lseg_perp(PG_FUNCTION_ARGS)
Datum box_contained(PG_FUNCTION_ARGS)
Datum path_div_pt(PG_FUNCTION_ARGS)
static bool lseg_interpt_line(Point *result, LSEG *lseg, LINE *line)
Datum point_in(PG_FUNCTION_ARGS)
Datum box_overleft(PG_FUNCTION_ARGS)
static bool point_eq_point(Point *pt1, Point *pt2)
Datum close_ps(PG_FUNCTION_ARGS)
Datum dist_polyp(PG_FUNCTION_ARGS)
Datum box_above(PG_FUNCTION_ARGS)
Datum poly_same(PG_FUNCTION_ARGS)
static void single_encode(float8 x, StringInfo str)
Datum point_vert(PG_FUNCTION_ARGS)
Datum poly_send(PG_FUNCTION_ARGS)
void pfree(void *pointer)
void * palloc0(Size size)
#define CHECK_FOR_INTERRUPTS()
#define SOFT_ERROR_OCCURRED(escontext)
char * psprintf(const char *fmt,...)
static pg_noinline void Size size
void check_stack_depth(void)
void appendStringInfo(StringInfo str, const char *fmt,...)
void appendStringInfoString(StringInfo str, const char *s)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
StringInfoData * StringInfo
Point p[FLEXIBLE_ARRAY_MEMBER]
Point p[FLEXIBLE_ARRAY_MEMBER]
#define SET_VARSIZE(PTR, len)