[Proj] Extracting the to_meter parameter from a projection

Hearne, Michael (US SSA) michael.hearne at baesystems.com
Tue Nov 15 14:18:53 EST 2005

I'm working on a piece of software that uses proj4 as a library.  I have
it working, and for the most part, understand how to get it to do what I
want.  What I cannot quite figure out, however, is how to determine the
units of a given projection.  I did a little digging through the source,
trying to find this, and the closest I could come to this was the
"PJconsts" struct defined in projects.h.  This structure contains
parameters "to_meter" and "from_meter", which presumably are values that
one could use to convert whatever units the projected values are in to
or from meters.

I have not been able to find anything that would tell me how to
instantiate a "PJconsts" structure.

If my usage to create a projection is something like this:

inProj = pj_init(nParams,(char**)params);

then is there a function (or chain of functions) that I can call that
will get me either the units of the projection, or the "to_meter" and
"from_meter" values?

I've already experimented with pj_get_def, and I get a string like this:

" +proj=utm +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0"

which has no information about the units or how to convert from whatever
the units might be.

More generally, is there any documentation (a la doxygen) on the Proj4


Mike Hearne

More information about the Proj mailing list