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

◆ ST_Snap()

Datum ST_Snap ( PG_FUNCTION_ARGS  )

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

3133{
3134 GSERIALIZED *geom1, *geom2, *result;
3135 LWGEOM *lwgeom1, *lwgeom2, *lwresult;
3136 double tolerance;
3137
3138 geom1 = PG_GETARG_GSERIALIZED_P(0);
3139 geom2 = PG_GETARG_GSERIALIZED_P(1);
3140 tolerance = PG_GETARG_FLOAT8(2);
3141
3142 lwgeom1 = lwgeom_from_gserialized(geom1);
3143 lwgeom2 = lwgeom_from_gserialized(geom2);
3144
3145 lwresult = lwgeom_snap(lwgeom1, lwgeom2, tolerance);
3146 lwgeom_free(lwgeom1);
3147 lwgeom_free(lwgeom2);
3148 PG_FREE_IF_COPY(geom1, 0);
3149 PG_FREE_IF_COPY(geom2, 1);
3150
3151 result = geometry_serialize(lwresult);
3152 lwgeom_free(lwresult);
3153
3154 PG_RETURN_POINTER(result);
3155}
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1138
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: