PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ ST_SharedPaths()

Datum ST_SharedPaths ( PG_FUNCTION_ARGS  )

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

3226 {
3227  GSERIALIZED *geom1, *geom2, *out;
3228  LWGEOM *g1, *g2, *lwgeom_out;
3229 
3230  geom1 = PG_GETARG_GSERIALIZED_P(0);
3231  geom2 = PG_GETARG_GSERIALIZED_P(1);
3232 
3233  g1 = lwgeom_from_gserialized(geom1);
3234  g2 = lwgeom_from_gserialized(geom2);
3235 
3236  lwgeom_out = lwgeom_sharedpaths(g1, g2);
3237  lwgeom_free(g1);
3238  lwgeom_free(g2);
3239 
3240  if ( ! lwgeom_out )
3241  {
3242  PG_FREE_IF_COPY(geom1, 0);
3243  PG_FREE_IF_COPY(geom2, 1);
3244  PG_RETURN_NULL();
3245  }
3246 
3247  out = geometry_serialize(lwgeom_out);
3248  lwgeom_free(lwgeom_out);
3249 
3250  PG_FREE_IF_COPY(geom1, 0);
3251  PG_FREE_IF_COPY(geom2, 1);
3252  PG_RETURN_POINTER(out);
3253 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
LWGEOM * lwgeom_sharedpaths(const LWGEOM *geom1, const LWGEOM *geom2)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

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

Here is the call graph for this function: