PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ ST_ReducePrecision()

Datum ST_ReducePrecision ( PG_FUNCTION_ARGS  )

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

1452 {
1453  GSERIALIZED *geom, *result;
1454  LWGEOM *lwgeom, *lwresult;
1455  double gridSize = PG_GETARG_FLOAT8(1);
1456  geom = PG_GETARG_GSERIALIZED_P(0);
1457 
1458  lwgeom = lwgeom_from_gserialized(geom);
1459  lwresult = lwgeom_reduceprecision(lwgeom, gridSize);
1460  lwgeom_free(lwgeom);
1461  PG_FREE_IF_COPY(geom, 0);
1462 
1463  if (!lwresult) PG_RETURN_NULL();
1464 
1465  result = geometry_serialize(lwresult);
1466  lwgeom_free(lwresult);
1467  PG_RETURN_POINTER(result);
1468 }
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: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: