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

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

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

3772 {
3773 #if POSTGIS_GEOS_VERSION < 33
3774  lwpgerror("The GEOS version this PostGIS binary "
3775  "was compiled against (%d) doesn't support "
3776  "'ST_SharedPaths' function (3.3.0+ required)",
3778  PG_RETURN_NULL();
3779 #else /* POSTGIS_GEOS_VERSION >= 33 */
3780  GSERIALIZED *geom1, *geom2, *out;
3781  LWGEOM *g1, *g2, *lwgeom_out;
3782 
3783  geom1 = PG_GETARG_GSERIALIZED_P(0);
3784  geom2 = PG_GETARG_GSERIALIZED_P(1);
3785 
3786  g1 = lwgeom_from_gserialized(geom1);
3787  g2 = lwgeom_from_gserialized(geom2);
3788 
3789  lwgeom_out = lwgeom_sharedpaths(g1, g2);
3790  lwgeom_free(g1);
3791  lwgeom_free(g2);
3792 
3793  if ( ! lwgeom_out )
3794  {
3795  PG_FREE_IF_COPY(geom1, 0);
3796  PG_FREE_IF_COPY(geom2, 1);
3797  PG_RETURN_NULL();
3798  }
3799 
3800  out = geometry_serialize(lwgeom_out);
3801  lwgeom_free(lwgeom_out);
3802 
3803  PG_FREE_IF_COPY(geom1, 0);
3804  PG_FREE_IF_COPY(geom2, 1);
3805  PG_RETURN_POINTER(out);
3806 
3807 #endif /* POSTGIS_GEOS_VERSION >= 33 */
3808 
3809 }
#define POSTGIS_GEOS_VERSION
Definition: sqldefines.h:10
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:1050
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: