390 double size = PG_GETARG_FLOAT8(0);
392 int cell_i = PG_GETARG_INT32(1);
393 int cell_j = PG_GETARG_INT32(2);
400 elog(ERROR,
"%s: origin point is empty", __func__);
407 elog(ERROR,
"%s: origin argument is not a point", __func__);
412 size, cell_i, cell_j,
415 gsqr = geometry_serialize(lwsqr);
416 PG_FREE_IF_COPY(gorigin, 3);
417 PG_RETURN_POINTER(gsqr);
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
int32_t lwgeom_get_srid(const LWGEOM *geom)
Return SRID number.
double lwpoint_get_x(const LWPOINT *point)
double lwpoint_get_y(const LWPOINT *point)
static LWGEOM * square(double origin_x, double origin_y, double size, int cell_i, int cell_j, int32_t srid)
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
static LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)