PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ ST_SharedPaths()

Datum ST_SharedPaths ( PG_FUNCTION_ARGS  )

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

3443 {
3444  GSERIALIZED *geom1, *geom2, *out;
3445  LWGEOM *g1, *g2, *lwgeom_out;
3446 
3447  geom1 = PG_GETARG_GSERIALIZED_P(0);
3448  geom2 = PG_GETARG_GSERIALIZED_P(1);
3449 
3450  g1 = lwgeom_from_gserialized(geom1);
3451  g2 = lwgeom_from_gserialized(geom2);
3452 
3453  lwgeom_out = lwgeom_sharedpaths(g1, g2);
3454  lwgeom_free(g1);
3455  lwgeom_free(g2);
3456 
3457  if ( ! lwgeom_out )
3458  {
3459  PG_FREE_IF_COPY(geom1, 0);
3460  PG_FREE_IF_COPY(geom2, 1);
3461  PG_RETURN_NULL();
3462  }
3463 
3464  out = geometry_serialize(lwgeom_out);
3465  lwgeom_free(lwgeom_out);
3466 
3467  PG_FREE_IF_COPY(geom1, 0);
3468  PG_FREE_IF_COPY(geom2, 1);
3469  PG_RETURN_POINTER(out);
3470 }
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:1155
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: