2679 int n_args = PG_NARGS();
2682 for (i = 0; i < n_args; i++)
2684 seri_geoms[i] = PG_GETARG_GSERIALIZED_P(i);
2707 if (srids[0] != srids[i])
2719 for (j = 0; j <= i; j++)
2720 PG_FREE_IF_COPY(seri_geoms[j], j);
2723 lwpgerror(
"Empty geometry");
2728 lwpgerror(
"Argument must be POINT geometries");
2733 lwpgerror(
"Operation on mixed SRID geometries");
2738 for (i = 0; i < n_args; i++)
2744 for (j = 0; j < n_args; j++)
2745 PG_FREE_IF_COPY(seri_geoms[j], j);
2746 lwpgerror(
"Error unserializing geometry");
2755 lwpgerror(
"Error extracting point");
2783 PG_RETURN_FLOAT8(
result);
char result[OUT_DOUBLE_BUFFER_SIZE]
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)