PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ ST_SharedPaths()

Datum ST_SharedPaths ( PG_FUNCTION_ARGS  )

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

2418 {
2419  GSERIALIZED *geom1, *geom2, *out;
2420  LWGEOM *g1, *g2, *lwgeom_out;
2421 
2422  geom1 = PG_GETARG_GSERIALIZED_P(0);
2423  geom2 = PG_GETARG_GSERIALIZED_P(1);
2424 
2425  g1 = lwgeom_from_gserialized(geom1);
2426  g2 = lwgeom_from_gserialized(geom2);
2427 
2428  lwgeom_out = lwgeom_sharedpaths(g1, g2);
2429  lwgeom_free(g1);
2430  lwgeom_free(g2);
2431 
2432  if ( ! lwgeom_out )
2433  {
2434  PG_FREE_IF_COPY(geom1, 0);
2435  PG_FREE_IF_COPY(geom2, 1);
2436  PG_RETURN_NULL();
2437  }
2438 
2439  out = geometry_serialize(lwgeom_out);
2440  lwgeom_free(lwgeom_out);
2441 
2442  PG_FREE_IF_COPY(geom1, 0);
2443  PG_FREE_IF_COPY(geom2, 1);
2444  PG_RETURN_POINTER(out);
2445 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:268
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1218
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: