Definition at line 80 of file lwgeom_spheroid.c.
82 char *
str = PG_GETARG_CSTRING(0);
89 if (strstr(
str,
"SPHEROID") !=
str )
91 elog(ERROR,
"SPHEROID parser - doesn't start with SPHEROID");
96 nitems = sscanf(
str,
"SPHEROID[\"%19[^\"]\",%lf,%lf]",
97 sphere->
name, &sphere->
a, &rf);
100 nitems = sscanf(
str,
"SPHEROID(\"%19[^\"]\",%lf,%lf)",
101 sphere->
name, &sphere->
a, &rf);
105 elog(ERROR,
"SPHEROID parser - couldnt parse the spheroid");
111 sphere->
b = sphere->
a - (1.0/rf)*sphere->
a;
112 sphere->
e_sq = ((sphere->
a*sphere->
a) - (sphere->
b*sphere->
b)) /
113 (sphere->
a*sphere->
a);
114 sphere->
e = sqrt(sphere->
e_sq);
116 PG_RETURN_POINTER(sphere);
References SPHEROID::a, SPHEROID::b, SPHEROID::e, SPHEROID::e_sq, SPHEROID::f, SPHEROID::name, and str.