PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ ST_Snap()

Datum ST_Snap ( PG_FUNCTION_ARGS  )

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

3126 {
3127  GSERIALIZED *geom1, *geom2, *result;
3128  LWGEOM *lwgeom1, *lwgeom2, *lwresult;
3129  double tolerance;
3130 
3131  geom1 = PG_GETARG_GSERIALIZED_P(0);
3132  geom2 = PG_GETARG_GSERIALIZED_P(1);
3133  tolerance = PG_GETARG_FLOAT8(2);
3134 
3135  lwgeom1 = lwgeom_from_gserialized(geom1);
3136  lwgeom2 = lwgeom_from_gserialized(geom2);
3137 
3138  lwresult = lwgeom_snap(lwgeom1, lwgeom2, tolerance);
3139  lwgeom_free(lwgeom1);
3140  lwgeom_free(lwgeom2);
3141  PG_FREE_IF_COPY(geom1, 0);
3142  PG_FREE_IF_COPY(geom2, 1);
3143 
3144  result = geometry_serialize(lwresult);
3145  lwgeom_free(lwresult);
3146 
3147  PG_RETURN_POINTER(result);
3148 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
LWGEOM * lwgeom_snap(const LWGEOM *geom1, const LWGEOM *geom2, double tolerance)
Snap vertices and segments of a geometry to another using a given tolerance.
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

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

Here is the call graph for this function: