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

Definition at line 109 of file lwgeom_spheroid.c.

References SPHEROID::a, SPHEROID::f, MAX_DIGS_DOUBLE, SPHEROID::name, and result.

110 {
111  SPHEROID *sphere = (SPHEROID *) PG_GETARG_POINTER(0);
112  char *result;
113 
114  result = palloc(MAX_DIGS_DOUBLE + MAX_DIGS_DOUBLE + 20 + 9 + 2);
115 
116  sprintf(result,"SPHEROID(\"%s\",%.15g,%.15g)",
117  sphere->name, sphere->a, 1.0/sphere->f);
118 
119  PG_RETURN_CSTRING(result);
120 }
#define MAX_DIGS_DOUBLE
char ** result
Definition: liblwgeom.h:218
double f
Definition: liblwgeom.h:271
double a
Definition: liblwgeom.h:269
char name[20]
Definition: liblwgeom.h:275