PostGIS  2.1.10dev-r@@SVN_REVISION@@
Datum sfcgal_distance ( PG_FUNCTION_ARGS  )

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

References POSTGIS2SFCGALGeometry(), result, and sfcgal_postgis_init().

274 {
275  GSERIALIZED *input0, *input1;
276  sfcgal_geometry_t *geom0, *geom1;
277  double result;
278 
280 
281  input0 = (GSERIALIZED*) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
282  input1 = (GSERIALIZED*) PG_DETOAST_DATUM(PG_GETARG_DATUM(1));
283  geom0 = POSTGIS2SFCGALGeometry(input0);
284  PG_FREE_IF_COPY(input0, 0);
285  geom1 = POSTGIS2SFCGALGeometry(input1);
286  PG_FREE_IF_COPY(input1, 1);
287 
288  result = sfcgal_geometry_distance(geom0, geom1);
289  sfcgal_geometry_delete(geom0);
290  sfcgal_geometry_delete(geom1);
291 
292  PG_RETURN_FLOAT8(result);
293 }
sfcgal_geometry_t * POSTGIS2SFCGALGeometry(GSERIALIZED *pglwgeom)
char ** result
Definition: liblwgeom.h:218
void sfcgal_postgis_init(void)

Here is the call graph for this function: