PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ ST_Snap()

Datum ST_Snap ( PG_FUNCTION_ARGS  )

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

2307{
2308 GSERIALIZED *geom1, *geom2, *result;
2309 LWGEOM *lwgeom1, *lwgeom2, *lwresult;
2310 double tolerance;
2311
2312 geom1 = PG_GETARG_GSERIALIZED_P(0);
2313 geom2 = PG_GETARG_GSERIALIZED_P(1);
2314 tolerance = PG_GETARG_FLOAT8(2);
2315
2316 lwgeom1 = lwgeom_from_gserialized(geom1);
2317 lwgeom2 = lwgeom_from_gserialized(geom2);
2318
2319 lwresult = lwgeom_snap(lwgeom1, lwgeom2, tolerance);
2320 lwgeom_free(lwgeom1);
2321 lwgeom_free(lwgeom2);
2322 PG_FREE_IF_COPY(geom1, 0);
2323 PG_FREE_IF_COPY(geom2, 1);
2324
2325 result = geometry_serialize(lwresult);
2326 lwgeom_free(lwresult);
2327
2328 PG_RETURN_POINTER(result);
2329}
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.
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
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: