2386 geom = PG_GETARG_GSERIALIZED_P(0);
2390 PG_FREE_IF_COPY(geom, 0);
2391 lwpgerror(
"Argument must be POINT geometries");
2394 srid = lwpoint->
srid;
2397 PG_FREE_IF_COPY(geom, 0);
2398 lwpgerror(
"Error extracting point");
2402 PG_FREE_IF_COPY(geom, 0);
2405 geom = PG_GETARG_GSERIALIZED_P(1);
2409 PG_FREE_IF_COPY(geom, 1);
2410 lwpgerror(
"Argument must be POINT geometries");
2413 if ( lwpoint->
srid != srid )
2415 PG_FREE_IF_COPY(geom, 1);
2416 lwpgerror(
"Operation on mixed SRID geometries");
2421 PG_FREE_IF_COPY(geom, 1);
2422 lwpgerror(
"Error extracting point");
2426 PG_FREE_IF_COPY(geom, 1);
2429 if ( (p1.
x == p2.
x) && (p1.
y == p2.
y) )
2440 PG_RETURN_FLOAT8(result);
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)
LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)