PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ ST_SharedPaths()

Datum ST_SharedPaths ( PG_FUNCTION_ARGS  )

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

3402 {
3403  GSERIALIZED *geom1, *geom2, *out;
3404  LWGEOM *g1, *g2, *lwgeom_out;
3405 
3406  geom1 = PG_GETARG_GSERIALIZED_P(0);
3407  geom2 = PG_GETARG_GSERIALIZED_P(1);
3408 
3409  g1 = lwgeom_from_gserialized(geom1);
3410  g2 = lwgeom_from_gserialized(geom2);
3411 
3412  lwgeom_out = lwgeom_sharedpaths(g1, g2);
3413  lwgeom_free(g1);
3414  lwgeom_free(g2);
3415 
3416  if ( ! lwgeom_out )
3417  {
3418  PG_FREE_IF_COPY(geom1, 0);
3419  PG_FREE_IF_COPY(geom2, 1);
3420  PG_RETURN_NULL();
3421  }
3422 
3423  out = geometry_serialize(lwgeom_out);
3424  lwgeom_free(lwgeom_out);
3425 
3426  PG_FREE_IF_COPY(geom1, 0);
3427  PG_FREE_IF_COPY(geom2, 1);
3428  PG_RETURN_POINTER(out);
3429 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:239
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1138
LWGEOM * lwgeom_sharedpaths(const LWGEOM *geom1, const LWGEOM *geom2)

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

Here is the call graph for this function: