2518 geom = PG_GETARG_GSERIALIZED_P(0);
2522 PG_FREE_IF_COPY(geom, 0);
2523 lwpgerror(
"Argument must be POINT geometries");
2526 srid = lwpoint->
srid;
2529 PG_FREE_IF_COPY(geom, 0);
2530 lwpgerror(
"Error extracting point");
2534 PG_FREE_IF_COPY(geom, 0);
2537 geom = PG_GETARG_GSERIALIZED_P(1);
2541 PG_FREE_IF_COPY(geom, 1);
2542 lwpgerror(
"Argument must be POINT geometries");
2545 if (lwpoint->
srid != srid)
2547 PG_FREE_IF_COPY(geom, 1);
2548 lwpgerror(
"Operation on mixed SRID geometries");
2553 PG_FREE_IF_COPY(geom, 1);
2554 lwpgerror(
"Error extracting point");
2558 PG_FREE_IF_COPY(geom, 1);
2561 if ((p1.
x == p2.
x) && (p1.
y == p2.
y))
2572 PG_RETURN_FLOAT8(
result);
char result[OUT_DOUBLE_BUFFER_SIZE]
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
int azimuth_pt_pt(const POINT2D *p1, const POINT2D *p2, double *ret)
Compute the azimuth of segment AB in radians.
void lwpoint_free(LWPOINT *pt)
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
static LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)