333{
338
340
341
343
344 grid.
ipx = PG_GETARG_FLOAT8(1);
345 grid.
ipy = PG_GETARG_FLOAT8(2);
346 grid.
xsize = PG_GETARG_FLOAT8(3);
347 grid.
ysize = PG_GETARG_FLOAT8(4);
348
349
351 {
352 PG_RETURN_POINTER(in_geom);
353 }
354
355
357 {
358 PG_RETURN_POINTER(in_geom);
359 }
360
362
363 POSTGIS_DEBUGF(3,
"SnapToGrid got a %s",
lwtype_name(in_lwgeom->
type));
364
366 if ( out_lwgeom == NULL ) PG_RETURN_NULL();
367
368
369 if ( in_lwgeom->
bbox )
371
372 POSTGIS_DEBUGF(3,
"SnapToGrid made a %s",
lwtype_name(out_lwgeom->
type));
373
374 out_geom = geometry_serialize(out_lwgeom);
375
376 PG_RETURN_POINTER(out_geom);
377}
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.
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
void lwgeom_refresh_bbox(LWGEOM *lwgeom)
Drop current bbox and calculate a fresh one.
LWGEOM * lwgeom_grid(const LWGEOM *lwgeom, gridspec *grid)