PostGIS  2.5.0dev-r@@SVN_REVISION@@
Datum ST_SharedPaths ( PG_FUNCTION_ARGS  )

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

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

3380 {
3381  GSERIALIZED *geom1, *geom2, *out;
3382  LWGEOM *g1, *g2, *lwgeom_out;
3383 
3384  geom1 = PG_GETARG_GSERIALIZED_P(0);
3385  geom2 = PG_GETARG_GSERIALIZED_P(1);
3386 
3387  g1 = lwgeom_from_gserialized(geom1);
3388  g2 = lwgeom_from_gserialized(geom2);
3389 
3390  lwgeom_out = lwgeom_sharedpaths(g1, g2);
3391  lwgeom_free(g1);
3392  lwgeom_free(g2);
3393 
3394  if ( ! lwgeom_out )
3395  {
3396  PG_FREE_IF_COPY(geom1, 0);
3397  PG_FREE_IF_COPY(geom2, 1);
3398  PG_RETURN_NULL();
3399  }
3400 
3401  out = geometry_serialize(lwgeom_out);
3402  lwgeom_free(lwgeom_out);
3403 
3404  PG_FREE_IF_COPY(geom1, 0);
3405  PG_FREE_IF_COPY(geom2, 1);
3406  PG_RETURN_POINTER(out);
3407 }
LWGEOM * lwgeom_sharedpaths(const LWGEOM *geom1, const LWGEOM *geom2)
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1137
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: