2480 int n_args = PG_NARGS();
2483 for (i = 0; i < n_args; i++)
2485 seri_geoms[i] = PG_GETARG_GSERIALIZED_P(i);
2508 if (srids[0] != srids[i])
2520 for (j = 0; j <= i; j++)
2521 PG_FREE_IF_COPY(seri_geoms[j], j);
2524 lwpgerror(
"Empty geometry");
2529 lwpgerror(
"Argument must be POINT geometries");
2534 lwpgerror(
"Operation on mixed SRID geometries");
2539 for (i = 0; i < n_args; i++)
2545 for (j = 0; j < n_args; j++)
2546 PG_FREE_IF_COPY(seri_geoms[j], j);
2547 lwpgerror(
"Error unserializing geometry");
2556 lwpgerror(
"Error extracting point");
2583 result += (result < 0) * 2 * M_PI;
2584 PG_RETURN_FLOAT8(result);
int32_t gserialized_get_srid(const GSERIALIZED *g)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
int gserialized_is_empty(const GSERIALIZED *g)
Check if a GSERIALIZED is empty without deserializing first.
uint32_t gserialized_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
int azimuth_pt_pt(const POINT2D *p1, const POINT2D *p2, double *ret)
Compute the azimuth of segment AB in radians.
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
static LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)