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

◆ ST_SharedPaths()

Datum ST_SharedPaths ( PG_FUNCTION_ARGS  )

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

3245{
3246 GSERIALIZED *geom1, *geom2, *out;
3247 LWGEOM *g1, *g2, *lwgeom_out;
3248
3249 geom1 = PG_GETARG_GSERIALIZED_P(0);
3250 geom2 = PG_GETARG_GSERIALIZED_P(1);
3251
3252 g1 = lwgeom_from_gserialized(geom1);
3253 g2 = lwgeom_from_gserialized(geom2);
3254
3255 lwgeom_out = lwgeom_sharedpaths(g1, g2);
3256 lwgeom_free(g1);
3257 lwgeom_free(g2);
3258
3259 if ( ! lwgeom_out )
3260 {
3261 PG_FREE_IF_COPY(geom1, 0);
3262 PG_FREE_IF_COPY(geom2, 1);
3263 PG_RETURN_NULL();
3264 }
3265
3266 out = geometry_serialize(lwgeom_out);
3267 lwgeom_free(lwgeom_out);
3268
3269 PG_FREE_IF_COPY(geom1, 0);
3270 PG_FREE_IF_COPY(geom2, 1);
3271 PG_RETURN_POINTER(out);
3272}
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_sharedpaths(const LWGEOM *geom1, const LWGEOM *geom2)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

References geometry_serialize(), lwgeom_free(), lwgeom_from_gserialized(), and lwgeom_sharedpaths().

Here is the call graph for this function: