diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/pj_utils.c | 17 | ||||
| -rw-r--r-- | src/proj_api.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/pj_utils.c b/src/pj_utils.c index 15adcd93..f3d642ad 100644 --- a/src/pj_utils.c +++ b/src/pj_utils.c @@ -154,3 +154,20 @@ PJ *pj_latlong_from_proj( PJ *pj_in ) return pj_init_plus_ctx( pj_in->ctx, defn ); } +/************************************************************************/ +/* pj_get_spheroid_defn() */ +/* */ +/* Fetch the internal definition of the spheroid. Note that */ +/* you can compute "b" from eccentricity_squared as: */ +/* */ +/* b = a * sqrt(1 - es) */ +/************************************************************************/ + +void pj_get_spheroid_defn(projPJ defn, double *major_axis, double *eccentricity_squared) +{ + if ( major_axis ) + *major_axis = defn->a; + + if ( eccentricity_squared ) + *eccentricity_squared = defn->es; +}; diff --git a/src/proj_api.h b/src/proj_api.h index 739a09bd..feae9aff 100644 --- a/src/proj_api.h +++ b/src/proj_api.h @@ -86,6 +86,7 @@ void pj_deallocate_grids(void); void pj_clear_initcache(void); int pj_is_latlong(projPJ); int pj_is_geocent(projPJ); +void pj_get_spheroid_defn(projPJ defn, double *major_axis, double *eccentricity_squared); void pj_pr_list(projPJ); void pj_free(projPJ); void pj_set_finder( const char *(*)(const char *) ); |
