PostGIS  2.5.2dev-r@@SVN_REVISION@@

◆ ST_Snap()

Datum ST_Snap ( PG_FUNCTION_ARGS  )

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

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

Referenced by ST_DelaunayTriangles().

3128 {
3129  GSERIALIZED *geom1, *geom2, *result;
3130  LWGEOM *lwgeom1, *lwgeom2, *lwresult;
3131  double tolerance;
3132 
3133  geom1 = PG_GETARG_GSERIALIZED_P(0);
3134  geom2 = PG_GETARG_GSERIALIZED_P(1);
3135  tolerance = PG_GETARG_FLOAT8(2);
3136 
3137  lwgeom1 = lwgeom_from_gserialized(geom1);
3138  lwgeom2 = lwgeom_from_gserialized(geom2);
3139 
3140  lwresult = lwgeom_snap(lwgeom1, lwgeom2, tolerance);
3141  lwgeom_free(lwgeom1);
3142  lwgeom_free(lwgeom2);
3143  PG_FREE_IF_COPY(geom1, 0);
3144  PG_FREE_IF_COPY(geom2, 1);
3145 
3146  result = geometry_serialize(lwresult);
3147  lwgeom_free(lwresult);
3148 
3149  PG_RETURN_POINTER(result);
3150 }
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)
Here is the call graph for this function:
Here is the caller graph for this function: