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

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

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

3458 {
3459  GSERIALIZED *geom1, *geom2, *out;
3460  LWGEOM *g1, *g2, *lwgeom_out;
3461 
3462  geom1 = PG_GETARG_GSERIALIZED_P(0);
3463  geom2 = PG_GETARG_GSERIALIZED_P(1);
3464 
3465  g1 = lwgeom_from_gserialized(geom1);
3466  g2 = lwgeom_from_gserialized(geom2);
3467 
3468  lwgeom_out = lwgeom_sharedpaths(g1, g2);
3469  lwgeom_free(g1);
3470  lwgeom_free(g2);
3471 
3472  if ( ! lwgeom_out )
3473  {
3474  PG_FREE_IF_COPY(geom1, 0);
3475  PG_FREE_IF_COPY(geom2, 1);
3476  PG_RETURN_NULL();
3477  }
3478 
3479  out = geometry_serialize(lwgeom_out);
3480  lwgeom_free(lwgeom_out);
3481 
3482  PG_FREE_IF_COPY(geom1, 0);
3483  PG_FREE_IF_COPY(geom2, 1);
3484  PG_RETURN_POINTER(out);
3485 }
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:1063
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: