2714 int n_args = PG_NARGS();
2717 for (i = 0; i < n_args; i++)
2719 seri_geoms[i] = PG_GETARG_GSERIALIZED_P(i);
2742 if (srids[0] != srids[i])
2754 for (j = 0; j <= i; j++)
2755 PG_FREE_IF_COPY(seri_geoms[j], j);
2758 lwpgerror(
"Empty geometry");
2763 lwpgerror(
"Argument must be POINT geometries");
2768 lwpgerror(
"Operation on mixed SRID geometries");
2773 for (i = 0; i < n_args; i++)
2779 for (j = 0; j < n_args; j++)
2780 PG_FREE_IF_COPY(seri_geoms[j], j);
2781 lwpgerror(
"Error unserializing geometry");
2790 lwpgerror(
"Error extracting point");
2818 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)