2308 LWGEOM *lwgeom1, *lwgeom2, *lwresult;
2311 geom1 = PG_GETARG_GSERIALIZED_P(0);
2312 geom2 = PG_GETARG_GSERIALIZED_P(1);
2313 tolerance = PG_GETARG_FLOAT8(2);
2318 lwresult =
lwgeom_snap(lwgeom1, lwgeom2, tolerance);
2321 PG_FREE_IF_COPY(geom1, 0);
2322 PG_FREE_IF_COPY(geom2, 1);
2324 result = geometry_serialize(lwresult);
2327 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.