PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ ST_ReducePrecision()

Datum ST_ReducePrecision ( PG_FUNCTION_ARGS  )

Definition at line 1506 of file postgis/lwgeom_geos.c.

1507 {
1508  GSERIALIZED *geom, *result;
1509  LWGEOM *lwgeom, *lwresult;
1510  double gridSize = PG_GETARG_FLOAT8(1);
1511  geom = PG_GETARG_GSERIALIZED_P(0);
1512 
1513  lwgeom = lwgeom_from_gserialized(geom);
1514  lwresult = lwgeom_reduceprecision(lwgeom, gridSize);
1515  lwgeom_free(lwgeom);
1516  PG_FREE_IF_COPY(geom, 0);
1517 
1518  if (!lwresult) PG_RETURN_NULL();
1519 
1520  result = geometry_serialize(lwresult);
1521  lwgeom_free(lwresult);
1522  PG_RETURN_POINTER(result);
1523 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:267
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:268
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1218
LWGEOM * lwgeom_reduceprecision(const LWGEOM *geom, double gridSize)

References lwgeom_free(), lwgeom_from_gserialized(), lwgeom_reduceprecision(), and result.

Here is the call graph for this function: