PostGIS  2.2.7dev-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, and SPHEROID::name.

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
double f
Definition: liblwgeom.h:299
double a
Definition: liblwgeom.h:297
char name[20]
Definition: liblwgeom.h:303