388{
390 double size = PG_GETARG_FLOAT8(0);
392 int cell_i = PG_GETARG_INT32(1);
393 int cell_j = PG_GETARG_INT32(2);
397
399 {
400 elog(ERROR, "%s: origin point is empty", __func__);
401 PG_RETURN_NULL();
402 }
403
405 if (!lwpt)
406 {
407 elog(ERROR, "%s: origin argument is not a point", __func__);
408 PG_RETURN_NULL();
409 }
410
412 size, cell_i, cell_j,
414
415 gsqr = geometry_serialize(lwsqr);
416 PG_FREE_IF_COPY(gorigin, 3);
417 PG_RETURN_POINTER(gsqr);
418}
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 LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)