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

Definition at line 465 of file geography_measurement.c.

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

466 {
467  GSERIALIZED *g = NULL;
468  GSERIALIZED *g_out = NULL;
469  double distance;
470 
471  /* Get a wholly-owned pointer to the geography */
472  g = PG_GETARG_GSERIALIZED_P_COPY(0);
473 
474  /* Read our distance value and normalize to unit-sphere. */
475  distance = PG_GETARG_FLOAT8(1) / WGS84_RADIUS;
476 
477  /* Try the expansion */
478  g_out = gserialized_expand(g, distance);
479 
480  /* If the expansion fails, the return our input */
481  if ( g_out == NULL )
482  {
483  PG_RETURN_POINTER(g);
484  }
485 
486  if ( g_out != g )
487  {
488  pfree(g);
489  }
490 
491  PG_RETURN_POINTER(g_out);
492 }
#define WGS84_RADIUS
Definition: liblwgeom.h:130
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: