Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am using Proj4js along with OpenLayers for the transformation of x,y (projection type is Transverse Mercator) to long, lat.

While executing "inverse()" method what I noticed that in tmerc.js some "this.ep2" parameter is used with in the formula and the value of this parameter is "NaN".

Because of this the transformation is not working.

I am guessing that this is happening because perhaps I am not initializing required parameter with in the definition file of the source coordinate system.

So, could anyone help me in knowing which parameter for "this.ep2" has to be passed in definition file?

Thanks in advance

share|improve this question
    
i just realized that I didn't answer the question but maybe there's enough information to help you. –  mkennedy May 25 '12 at 15:46
    
@mkennedy - That seems easily remedied! :) –  Get Spatial May 25 '12 at 15:50
add comment

2 Answers 2

My guess without looking at the code is eccentricity prime squared. It can be calculated with:

a*a/b*b - 1

or

f*(2 - f) / (1 - f)*(1 - f)

a = semimajor axis b = semiminor axis f = flattening

It's interesting because usually e squared is used.

share|improve this answer
    
thanks mKennedy :)...I got confused because I was expecting parameter "es" rather than "ep2"...that's because in the parameter list of "Proj4JS" they have mentioned parameter "es" for eccentricity prime squared...I guess there is a gap between standard parameter name & the variable name :) –  G.S.Tomar May 26 '12 at 9:39
add comment

ep2 is calculated as follows in proj4js.js (the un-minified source) around line 964:

 this.ep2=(this.a2-this.b2)/this.b2; // used in geocentric

where a2, b2 are a,b squared respectively; a is the semi-major radius and b the semi-minor radius.

ep2 should have been initialized at projection loading time, so perhaps you're missing something in your proj definition.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.