PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ ST_ReducePrecision()

Datum ST_ReducePrecision ( PG_FUNCTION_ARGS  )

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

1569 {
1570  GSERIALIZED *geom, *result;
1571  LWGEOM *lwgeom, *lwresult;
1572  double gridSize = PG_GETARG_FLOAT8(1);
1573  geom = PG_GETARG_GSERIALIZED_P(0);
1574 
1575  lwgeom = lwgeom_from_gserialized(geom);
1576  lwresult = lwgeom_reduceprecision(lwgeom, gridSize);
1577  lwgeom_free(lwgeom);
1578  PG_FREE_IF_COPY(geom, 0);
1579 
1580  if (!lwresult) PG_RETURN_NULL();
1581 
1582  result = geometry_serialize(lwresult);
1583  lwgeom_free(lwresult);
1584  PG_RETURN_POINTER(result);
1585 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:262
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:239
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1155
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: