PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ ST_SharedPaths()

Datum ST_SharedPaths ( PG_FUNCTION_ARGS  )

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

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

Referenced by ST_Split().

3229 {
3230  GSERIALIZED *geom1, *geom2, *out;
3231  LWGEOM *g1, *g2, *lwgeom_out;
3232 
3233  geom1 = PG_GETARG_GSERIALIZED_P(0);
3234  geom2 = PG_GETARG_GSERIALIZED_P(1);
3235 
3236  g1 = lwgeom_from_gserialized(geom1);
3237  g2 = lwgeom_from_gserialized(geom2);
3238 
3239  lwgeom_out = lwgeom_sharedpaths(g1, g2);
3240  lwgeom_free(g1);
3241  lwgeom_free(g2);
3242 
3243  if ( ! lwgeom_out )
3244  {
3245  PG_FREE_IF_COPY(geom1, 0);
3246  PG_FREE_IF_COPY(geom2, 1);
3247  PG_RETURN_NULL();
3248  }
3249 
3250  out = geometry_serialize(lwgeom_out);
3251  lwgeom_free(lwgeom_out);
3252 
3253  PG_FREE_IF_COPY(geom1, 0);
3254  PG_FREE_IF_COPY(geom2, 1);
3255  PG_RETURN_POINTER(out);
3256 }
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:1144
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
Here is the call graph for this function:
Here is the caller graph for this function: