Loading lib/proj4js.js +1 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ Proj4js = { if (point[t]!==undefined) { point.z= -v; } break; default : alert("ERROR: unknow axis ("+crs.axis[i]+") - check definition of "+src.projName); alert("ERROR: unknow axis ("+crs.axis[i]+") - check definition of "+crs.projName); return null; } } Loading lib/projCode/aea.js +4 −4 Original line number Diff line number Diff line Loading @@ -106,13 +106,13 @@ Proj4js.Proj.aea = { lat = this.phi1z(this.e3,qs); } else { if (qs >= 0) { lat = .5 * PI; lat = .5 * Proj4js.common.PI; } else { lat = -.5 * PI; lat = -.5 * Proj4js.common.PI; } } } else { lat = this.phi1z(e3,qs); lat = this.phi1z(this.e3,qs); } lon = Proj4js.common.adjust_lon(theta/this.ns0 + this.long0); Loading @@ -125,7 +125,7 @@ Proj4js.Proj.aea = { Albers Conical Equal-Area projection. -------------------------------------------*/ phi1z: function (eccent,qs) { var con, com, dphi; var sinphi, cosphi, con, com, dphi; var phi = Proj4js.common.asinz(.5 * qs); if (eccent < Proj4js.common.EPSLN) return phi; Loading lib/projCode/cass.js +8 −7 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ Proj4js.Proj.cass = { p.y -= this.y0; var x = p.x/this.a; var y = p.y/this.a; var phi, lam; if (this.sphere) { this.dd = y + this.lat0; Loading @@ -87,7 +88,7 @@ Proj4js.Proj.cass = { lam = Math.atan2(Math.tan(x), Math.cos(this.dd)); } else { /* ellipsoid */ ph1 = this.pj_inv_mlfn(this.m0 + y, this.es, this.en); var ph1 = this.pj_inv_mlfn(this.m0 + y, this.es, this.en); this.tn = Math.tan(ph1); this.t = this.tn * this.tn; this.n = Math.sin(ph1); Loading @@ -107,7 +108,7 @@ Proj4js.Proj.cass = { //code from the PROJ.4 pj_mlfn.c file; this may be useful for other projections pj_enfn: function(es) { en = new Array(); var en = new Array(); en[0] = this.C00 - es * (this.C02 + es * (this.C04 + es * (this.C06 + es * this.C08))); en[1] = es * (this.C22 - es * (this.C04 + es * (this.C06 + es * this.C08))); var t = es * es; Loading @@ -125,10 +126,10 @@ Proj4js.Proj.cass = { }, pj_inv_mlfn: function(arg, es, en) { k = 1./(1.-es); phi = arg; for (i = Proj4js.common.MAX_ITER; i ; --i) { /* rarely goes over 2 iterations */ s = Math.sin(phi); var k = 1./(1.-es); var phi = arg; for (var i = Proj4js.common.MAX_ITER; i ; --i) { /* rarely goes over 2 iterations */ var s = Math.sin(phi); t = 1. - es * s * s; //t = this.pj_mlfn(phi, s, Math.cos(phi), en) - arg; //phi -= t * (t * Math.sqrt(t)) * k; Loading lib/projCode/cea.js +1 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ Proj4js.Proj.cea = { var lat=p.y; /* Forward equations -----------------*/ dlon = Proj4js.common.adjust_lon(lon -this.long0); var dlon = Proj4js.common.adjust_lon(lon -this.long0); var x = this.x0 + this.a * dlon * Math.cos(this.lat_ts); var y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts); /* Elliptical Forward Transform Loading lib/projCode/gauss.js +3 −3 Original line number Diff line number Diff line Loading @@ -2,8 +2,8 @@ Proj4js.Proj.gauss = { init : function() { sphi = Math.sin(this.lat0); cphi = Math.cos(this.lat0); var sphi = Math.sin(this.lat0); var cphi = Math.cos(this.lat0); cphi *= cphi; this.rc = Math.sqrt(1.0 - this.es) / (1.0 - this.es * sphi * sphi); this.C = Math.sqrt(1.0 + this.es * cphi * cphi / (1.0 - this.es)); Loading @@ -25,7 +25,7 @@ Proj4js.Proj.gauss = { var DEL_TOL = 1e-14; var lon = p.x / this.C; var lat = p.y; num = Math.pow(Math.tan(0.5 * lat + Proj4js.common.FORTPI)/this.K, 1./this.C); var num = Math.pow(Math.tan(0.5 * lat + Proj4js.common.FORTPI)/this.K, 1./this.C); for (var i = Proj4js.common.MAX_ITER; i>0; --i) { lat = 2.0 * Math.atan(num * Proj4js.common.srat(this.e * Math.sin(p.y), -0.5 * this.e)) - Proj4js.common.HALF_PI; if (Math.abs(lat - p.y) < DEL_TOL) break; Loading Loading
lib/proj4js.js +1 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ Proj4js = { if (point[t]!==undefined) { point.z= -v; } break; default : alert("ERROR: unknow axis ("+crs.axis[i]+") - check definition of "+src.projName); alert("ERROR: unknow axis ("+crs.axis[i]+") - check definition of "+crs.projName); return null; } } Loading
lib/projCode/aea.js +4 −4 Original line number Diff line number Diff line Loading @@ -106,13 +106,13 @@ Proj4js.Proj.aea = { lat = this.phi1z(this.e3,qs); } else { if (qs >= 0) { lat = .5 * PI; lat = .5 * Proj4js.common.PI; } else { lat = -.5 * PI; lat = -.5 * Proj4js.common.PI; } } } else { lat = this.phi1z(e3,qs); lat = this.phi1z(this.e3,qs); } lon = Proj4js.common.adjust_lon(theta/this.ns0 + this.long0); Loading @@ -125,7 +125,7 @@ Proj4js.Proj.aea = { Albers Conical Equal-Area projection. -------------------------------------------*/ phi1z: function (eccent,qs) { var con, com, dphi; var sinphi, cosphi, con, com, dphi; var phi = Proj4js.common.asinz(.5 * qs); if (eccent < Proj4js.common.EPSLN) return phi; Loading
lib/projCode/cass.js +8 −7 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ Proj4js.Proj.cass = { p.y -= this.y0; var x = p.x/this.a; var y = p.y/this.a; var phi, lam; if (this.sphere) { this.dd = y + this.lat0; Loading @@ -87,7 +88,7 @@ Proj4js.Proj.cass = { lam = Math.atan2(Math.tan(x), Math.cos(this.dd)); } else { /* ellipsoid */ ph1 = this.pj_inv_mlfn(this.m0 + y, this.es, this.en); var ph1 = this.pj_inv_mlfn(this.m0 + y, this.es, this.en); this.tn = Math.tan(ph1); this.t = this.tn * this.tn; this.n = Math.sin(ph1); Loading @@ -107,7 +108,7 @@ Proj4js.Proj.cass = { //code from the PROJ.4 pj_mlfn.c file; this may be useful for other projections pj_enfn: function(es) { en = new Array(); var en = new Array(); en[0] = this.C00 - es * (this.C02 + es * (this.C04 + es * (this.C06 + es * this.C08))); en[1] = es * (this.C22 - es * (this.C04 + es * (this.C06 + es * this.C08))); var t = es * es; Loading @@ -125,10 +126,10 @@ Proj4js.Proj.cass = { }, pj_inv_mlfn: function(arg, es, en) { k = 1./(1.-es); phi = arg; for (i = Proj4js.common.MAX_ITER; i ; --i) { /* rarely goes over 2 iterations */ s = Math.sin(phi); var k = 1./(1.-es); var phi = arg; for (var i = Proj4js.common.MAX_ITER; i ; --i) { /* rarely goes over 2 iterations */ var s = Math.sin(phi); t = 1. - es * s * s; //t = this.pj_mlfn(phi, s, Math.cos(phi), en) - arg; //phi -= t * (t * Math.sqrt(t)) * k; Loading
lib/projCode/cea.js +1 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ Proj4js.Proj.cea = { var lat=p.y; /* Forward equations -----------------*/ dlon = Proj4js.common.adjust_lon(lon -this.long0); var dlon = Proj4js.common.adjust_lon(lon -this.long0); var x = this.x0 + this.a * dlon * Math.cos(this.lat_ts); var y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts); /* Elliptical Forward Transform Loading
lib/projCode/gauss.js +3 −3 Original line number Diff line number Diff line Loading @@ -2,8 +2,8 @@ Proj4js.Proj.gauss = { init : function() { sphi = Math.sin(this.lat0); cphi = Math.cos(this.lat0); var sphi = Math.sin(this.lat0); var cphi = Math.cos(this.lat0); cphi *= cphi; this.rc = Math.sqrt(1.0 - this.es) / (1.0 - this.es * sphi * sphi); this.C = Math.sqrt(1.0 + this.es * cphi * cphi / (1.0 - this.es)); Loading @@ -25,7 +25,7 @@ Proj4js.Proj.gauss = { var DEL_TOL = 1e-14; var lon = p.x / this.C; var lat = p.y; num = Math.pow(Math.tan(0.5 * lat + Proj4js.common.FORTPI)/this.K, 1./this.C); var num = Math.pow(Math.tan(0.5 * lat + Proj4js.common.FORTPI)/this.K, 1./this.C); for (var i = Proj4js.common.MAX_ITER; i>0; --i) { lat = 2.0 * Math.atan(num * Proj4js.common.srat(this.e * Math.sin(p.y), -0.5 * this.e)) - Proj4js.common.HALF_PI; if (Math.abs(lat - p.y) < DEL_TOL) break; Loading