PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ geos_intersection()

Datum geos_intersection ( PG_FUNCTION_ARGS  )

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

References geometry_serialize(), geos_difference(), lwgeom_free(), lwgeom_from_gserialized(), lwgeom_intersection(), and PG_FUNCTION_INFO_V1().

Referenced by ST_OffsetCurve().

1222 {
1223  GSERIALIZED *geom1;
1224  GSERIALIZED *geom2;
1225  GSERIALIZED *result;
1226  LWGEOM *lwgeom1, *lwgeom2, *lwresult ;
1227 
1228  geom1 = PG_GETARG_GSERIALIZED_P(0);
1229  geom2 = PG_GETARG_GSERIALIZED_P(1);
1230 
1231  lwgeom1 = lwgeom_from_gserialized(geom1) ;
1232  lwgeom2 = lwgeom_from_gserialized(geom2) ;
1233 
1234  lwresult = lwgeom_intersection(lwgeom1, lwgeom2) ;
1235  result = geometry_serialize(lwresult) ;
1236 
1237  lwgeom_free(lwgeom1) ;
1238  lwgeom_free(lwgeom2) ;
1239  lwgeom_free(lwresult) ;
1240 
1241  PG_FREE_IF_COPY(geom1, 0);
1242  PG_FREE_IF_COPY(geom2, 1);
1243 
1244  PG_RETURN_POINTER(result);
1245 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
LWGEOM * lwgeom_intersection(const LWGEOM *geom1, const LWGEOM *geom2)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
Here is the call graph for this function:
Here is the caller graph for this function: