PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ ellipsoid_out()

Datum ellipsoid_out ( PG_FUNCTION_ARGS  )

Definition at line 122 of file lwgeom_spheroid.c.

123 {
124  SPHEROID *sphere = (SPHEROID *) PG_GETARG_POINTER(0);
125  char *result;
126 
127  result = palloc(MAX_DIGS_DOUBLE + MAX_DIGS_DOUBLE + 20 + 9 + 2);
128 
129  sprintf(result,"SPHEROID(\"%s\",%.15g,%.15g)",
130  sphere->name, sphere->a, 1.0/sphere->f);
131 
132  PG_RETURN_CSTRING(result);
133 }
#define MAX_DIGS_DOUBLE
double a
Definition: liblwgeom.h:316
double f
Definition: liblwgeom.h:318
char name[20]
Definition: liblwgeom.h:322

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