3346 LWGEOM *lwgeom1, *lwgeom2, *lwresult;
3349 geom1 = PG_GETARG_GSERIALIZED_P(0);
3350 geom2 = PG_GETARG_GSERIALIZED_P(1);
3351 tolerance = PG_GETARG_FLOAT8(2);
3356 lwresult =
lwgeom_snap(lwgeom1, lwgeom2, tolerance);
3359 PG_FREE_IF_COPY(geom1, 0);
3360 PG_FREE_IF_COPY(geom2, 1);
3362 result = geometry_serialize(lwresult);
3365 PG_RETURN_POINTER(
result);
char result[OUT_DOUBLE_BUFFER_SIZE]
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
LWGEOM * lwgeom_snap(const LWGEOM *geom1, const LWGEOM *geom2, double tolerance)
Snap vertices and segments of a geometry to another using a given tolerance.