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

Definition at line 361 of file geography_measurement.c.

References distance(), gserialized_expand(), and WGS84_RADIUS.

362 {
363  GSERIALIZED *g = NULL;
364  GSERIALIZED *g_out = NULL;
365  double distance;
366 
367  /* Get a wholly-owned pointer to the geography */
368  g = (GSERIALIZED*)PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(0));
369 
370  /* Read our distance value and normalize to unit-sphere. */
371  distance = PG_GETARG_FLOAT8(1) / WGS84_RADIUS;
372 
373  /* Try the expansion */
374  g_out = gserialized_expand(g, distance);
375 
376  /* If the expansion fails, the return our input */
377  if ( g_out == NULL )
378  {
379  PG_RETURN_POINTER(g);
380  }
381 
382  if ( g_out != g )
383  {
384  pfree(g);
385  }
386 
387  PG_RETURN_POINTER(g_out);
388 }
#define WGS84_RADIUS
Definition: liblwgeom.h:98
GSERIALIZED * gserialized_expand(GSERIALIZED *g, double distance)
Return a GSERIALIZED with an expanded bounding box.
Datum distance(PG_FUNCTION_ARGS)

Here is the call graph for this function: