PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ sfcgal_minkowski_sum()

Datum sfcgal_minkowski_sum ( PG_FUNCTION_ARGS  )

Definition at line 663 of file postgis/lwgeom_sfcgal.c.

664 {
665  GSERIALIZED *input0, *input1, *output;
666  sfcgal_geometry_t *geom0, *geom1;
667  sfcgal_geometry_t *result;
668  srid_t srid;
669 
671 
672  input0 = PG_GETARG_GSERIALIZED_P(0);
673  srid = gserialized_get_srid(input0);
674  input1 = PG_GETARG_GSERIALIZED_P(1);
675  geom0 = POSTGIS2SFCGALGeometry(input0);
676  PG_FREE_IF_COPY(input0, 0);
677  geom1 = POSTGIS2SFCGALGeometry(input1);
678  PG_FREE_IF_COPY(input1, 1);
679 
680  result = sfcgal_geometry_minkowski_sum(geom0, geom1);
681  sfcgal_geometry_delete(geom0);
682  sfcgal_geometry_delete(geom1);
683 
684  output = SFCGALGeometry2POSTGIS(result, 0, srid);
685  sfcgal_geometry_delete(result);
686 
687  PG_RETURN_POINTER(output);
688 }
int32_t gserialized_get_srid(const GSERIALIZED *s)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
Definition: g_serialized.c:100
sfcgal_geometry_t * POSTGIS2SFCGALGeometry(GSERIALIZED *pglwgeom)
void sfcgal_postgis_init(void)
GSERIALIZED * SFCGALGeometry2POSTGIS(const sfcgal_geometry_t *geom, int force3D, int SRID)

References gserialized_get_srid(), POSTGIS2SFCGALGeometry(), sfcgal_postgis_init(), and SFCGALGeometry2POSTGIS().

Here is the call graph for this function: