419 Pointer box2d_ptr = PG_GETARG_POINTER(0);
420 Pointer geom_ptr = PG_GETARG_POINTER(1);
425 if ( (box2d_ptr == NULL) && (geom_ptr == NULL) )
430 result = (
GBOX *)palloc(
sizeof(
GBOX));
432 if (box2d_ptr == NULL)
434 lwgeom = PG_GETARG_GSERIALIZED_P(1);
437 memcpy(result, &box,
sizeof(
GBOX));
438 PG_RETURN_POINTER(result);
442 if (geom_ptr == NULL)
444 memcpy(result, (
char *)PG_GETARG_DATUM(0),
sizeof(
GBOX));
445 PG_RETURN_POINTER(result);
450 lwgeom = PG_GETARG_GSERIALIZED_P(1);
454 memcpy(result, (
char *)PG_GETARG_DATUM(0),
sizeof(
GBOX));
455 PG_RETURN_POINTER(result);
458 a = (
GBOX *)PG_GETARG_DATUM(0);
466 PG_RETURN_POINTER(result);
int gserialized_get_gbox_p(const GSERIALIZED *g, GBOX *box)
Read the bounding box off a serialization and calculate one if it is not already there.