PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ sfcgal_minkowski_sum()

Datum sfcgal_minkowski_sum ( PG_FUNCTION_ARGS  )

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

434 {
435  GSERIALIZED *input0, *input1, *output;
436  sfcgal_geometry_t *geom0, *geom1;
437  sfcgal_geometry_t *result;
438  srid_t srid;
439 
441 
442  input0 = PG_GETARG_GSERIALIZED_P(0);
443  srid = gserialized_get_srid(input0);
444  input1 = PG_GETARG_GSERIALIZED_P(1);
445  geom0 = POSTGIS2SFCGALGeometry(input0);
446  PG_FREE_IF_COPY(input0, 0);
447  geom1 = POSTGIS2SFCGALGeometry(input1);
448  PG_FREE_IF_COPY(input1, 1);
449 
450  result = sfcgal_geometry_minkowski_sum(geom0, geom1);
451  sfcgal_geometry_delete(geom0);
452  sfcgal_geometry_delete(geom1);
453 
454  output = SFCGALGeometry2POSTGIS(result, 0, srid);
455  sfcgal_geometry_delete(result);
456 
457  PG_RETURN_POINTER(output);
458 }
int32_t gserialized_get_srid(const GSERIALIZED *g)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
Definition: gserialized.c:126
sfcgal_geometry_t * POSTGIS2SFCGALGeometry(GSERIALIZED *pglwgeom)
void sfcgal_postgis_init(void)
GSERIALIZED * SFCGALGeometry2POSTGIS(const sfcgal_geometry_t *geom, int force3D, int32_t SRID)

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

Here is the call graph for this function: