2364 geom = PG_GETARG_GSERIALIZED_P(0);
2368 PG_FREE_IF_COPY(geom, 0);
2369 lwpgerror(
"Argument must be POINT geometries");
2372 srid = lwpoint->
srid;
2375 PG_FREE_IF_COPY(geom, 0);
2376 lwpgerror(
"Error extracting point");
2380 PG_FREE_IF_COPY(geom, 0);
2383 geom = PG_GETARG_GSERIALIZED_P(1);
2387 PG_FREE_IF_COPY(geom, 1);
2388 lwpgerror(
"Argument must be POINT geometries");
2391 if ( lwpoint->
srid != srid )
2393 PG_FREE_IF_COPY(geom, 1);
2394 lwpgerror(
"Operation on mixed SRID geometries");
2399 PG_FREE_IF_COPY(geom, 1);
2400 lwpgerror(
"Error extracting point");
2404 PG_FREE_IF_COPY(geom, 1);
2407 if ( (p1.
x == p2.
x) && (p1.
y == p2.
y) )
2418 PG_RETURN_FLOAT8(result);
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwpoint_free(LWPOINT *pt)
LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)
int getPoint2d_p(const POINTARRAY *pa, int n, POINT2D *point)
int azimuth_pt_pt(const POINT2D *p1, const POINT2D *p2, double *ret)
Compute the azimuth of segment AB in radians.