PostGIS  3.4.0dev-r@@SVN_REVISION@@
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages

◆ ST_Snap()

Datum ST_Snap ( PG_FUNCTION_ARGS  )

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

3344 {
3345  GSERIALIZED *geom1, *geom2, *result;
3346  LWGEOM *lwgeom1, *lwgeom2, *lwresult;
3347  double tolerance;
3348 
3349  geom1 = PG_GETARG_GSERIALIZED_P(0);
3350  geom2 = PG_GETARG_GSERIALIZED_P(1);
3351  tolerance = PG_GETARG_FLOAT8(2);
3352 
3353  lwgeom1 = lwgeom_from_gserialized(geom1);
3354  lwgeom2 = lwgeom_from_gserialized(geom2);
3355 
3356  lwresult = lwgeom_snap(lwgeom1, lwgeom2, tolerance);
3357  lwgeom_free(lwgeom1);
3358  lwgeom_free(lwgeom2);
3359  PG_FREE_IF_COPY(geom1, 0);
3360  PG_FREE_IF_COPY(geom2, 1);
3361 
3362  result = geometry_serialize(lwresult);
3363  lwgeom_free(lwresult);
3364 
3365  PG_RETURN_POINTER(result);
3366 }
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_snap(const LWGEOM *geom1, const LWGEOM *geom2, double tolerance)
Snap vertices and segments of a geometry to another using a given tolerance.

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

Here is the call graph for this function: