Commit bd796ff8 authored by Calvin Metcalf's avatar Calvin Metcalf
Browse files

in which I start to fix it

parent 45a5cb79
Loading
Loading
Loading
Loading
+33 −32
Original line number Diff line number Diff line
@@ -97,15 +97,15 @@ proj4.Proj = proj4.Class({
      }else{
      
      // DGR 2008-08-03 : support urn and url
      if (srsCode.indexOf('urn:') == 0) {
      if (srsCode.indexOf('urn:') === 0) {
          //urn:ORIGINATOR:def:crs:CODESPACE:VERSION:ID
          var urn = srsCode.split(':');
          if ((urn[1] == 'ogc' || urn[1] =='x-ogc') &&
              (urn[2] =='def') &&
              (urn[3] =='crs')) {
          if ((urn[1] === 'ogc' || urn[1] =='x-ogc') &&
              (urn[2] ==='def') &&
              (urn[3] ==='crs')) {
              srsCode = urn[4]+':'+urn[urn.length-1];
          }
      } else if (srsCode.indexOf('http://') == 0) {
      } else if (srsCode.indexOf('http://') === 0) {
          //url#ID
          var url = srsCode.split('#');
          if (url[0].match(/epsg.org/)) {
@@ -124,17 +124,17 @@ proj4.Proj = proj4.Class({
          }
      }
      this.srsCode = srsCode.toUpperCase();
      if (this.srsCode.indexOf("EPSG") == 0) {
      if (this.srsCode.indexOf("EPSG") === 0) {
          this.srsCode = this.srsCode;
          this.srsAuth = 'epsg';
          this.srsProjNumber = this.srsCode.substring(5);
      // DGR 2007-11-20 : authority IGNF
      } else if (this.srsCode.indexOf("IGNF") == 0) {
      } else if (this.srsCode.indexOf("IGNF") === 0) {
          this.srsCode = this.srsCode;
          this.srsAuth = 'IGNF';
          this.srsProjNumber = this.srsCode.substring(5);
      // DGR 2008-06-19 : pseudo-authority CRS for WMS
      } else if (this.srsCode.indexOf("CRS") == 0) {
      } else if (this.srsCode.indexOf("CRS") === 0) {
          this.srsCode = this.srsCode;
          this.srsAuth = 'CRS';
          this.srsProjNumber = this.srsCode.substring(4);
@@ -181,7 +181,7 @@ proj4.Proj = proj4.Class({
    var wktContent = wktMatch[2];
    var wktTemp = wktContent.split(",");
    var wktName;
    if (wktObject.toUpperCase() == "TOWGS84") {
    if (wktObject.toUpperCase() === "TOWGS84") {
      wktName = wktObject;  //no name supplied for the TOWGS84 array
    } else {
      wktName = wktTemp.shift();
@@ -197,14 +197,14 @@ proj4.Proj = proj4.Class({
    }
    */
    
    var wktArray = new Array();
    var wktArray = [];
    var bkCount = 0;
    var obj = "";
    for (var i=0; i<wktTemp.length; ++i) {
      var token = wktTemp[i];
      for (var j=0; j<token.length; ++j) {
        if (token.charAt(j) == "[") ++bkCount;
        if (token.charAt(j) == "]") --bkCount;
      for (var j2=0; j2<token.length; ++j2) {
        if (token.charAt(j2) === "[") ++bkCount;
        if (token.charAt(j2) === "]") --bkCount;
      }
      obj += token;
      if (bkCount === 0) {
@@ -215,8 +215,8 @@ proj4.Proj = proj4.Class({
      }
    }
    
    //do something based on the type of the wktObject being parsed
    //add in variations in the spelling as required
    //this is grotesque -cwm
    var name,value;
    switch (wktObject) {
      case 'LOCAL_CS':
        this.projName = 'identity';
@@ -255,8 +255,8 @@ proj4.Proj = proj4.Class({
        this.unitsPerMeter = parseFloat(wktArray.shift());
        break;
      case 'PARAMETER':
        var name = wktName.toLowerCase();
        var value = parseFloat(wktArray.shift());
        name = wktName.toLowerCase();
        value = parseFloat(wktArray.shift());
        //there may be many variations on the wktName values, add in case
        //statements as required
        switch (name) {
@@ -286,8 +286,8 @@ proj4.Proj = proj4.Class({
        break;
      //DGR 2010-11-12: AXIS
      case 'AXIS':
        var name= wktName.toLowerCase();
        var value= wktArray.shift();
        name= wktName.toLowerCase();
        value= wktArray.shift();
        switch (value) {
          case 'EAST' : value= 'e'; break;
          case 'WEST' : value= 'w'; break;
@@ -295,7 +295,7 @@ proj4.Proj = proj4.Class({
          case 'SOUTH': value= 's'; break;
          case 'UP'   : value= 'u'; break;
          case 'DOWN' : value= 'd'; break;
          case 'OTHER':
          //case 'OTHER': 
          default     : value= ' '; break;//FIXME
        }
        if (!this.axis) { this.axis= "enu"; }
@@ -305,13 +305,14 @@ proj4.Proj = proj4.Class({
          case 'z': this.axis= this.axis.substr(0,2) + value                        ; break;
          default : break;
        }
        break;
      case 'MORE_HERE':
        break;
      default:
        break;
    }
    for (var i=0; i<wktArray.length; ++i) {
      this.parseWKT(wktArray[i]);
    for (var j=0; j<wktArray.length; ++j) {
      this.parseWKT(wktArray[j]);
    }
 },

@@ -389,7 +390,7 @@ proj4.Proj = proj4.Class({
              // DGR 2010-11-12: axis
              case "axis":   paramVal = paramVal.replace(/\s/gi,"");
                             var legalAxis= "ewnsud";
                             if (paramVal.length==3 &&
                             if (paramVal.length===3 &&
                                 legalAxis.indexOf(paramVal.substr(0,1))!=-1 &&
                                 legalAxis.indexOf(paramVal.substr(1,1))!=-1 &&
                                 legalAxis.indexOf(paramVal.substr(2,1))!=-1) {
@@ -412,7 +413,7 @@ proj4.Proj = proj4.Class({
 */
  deriveConstants: function() {
      // DGR 2011-03-20 : nagrids -> nadgrids
      if (this.nadgrids && this.nadgrids.length==0) {
      if (this.nadgrids && this.nadgrids.length===0) {
          this.nadgrids= null;
      }
      if (this.nadgrids) {
@@ -422,12 +423,12 @@ proj4.Proj = proj4.Class({
          for (var i= 0; i<l; i++) {
            g= this.grids[i];
            var fg= g.split("@");
            if (fg[fg.length-1]=="") {
            if (fg[fg.length-1]==="") {
              proj4.reportError("nadgrids syntax error '"+this.nadgrids+"' : empty grid found");
              continue;
            }
            this.grids[i]= {
              mandatory: fg.length==1,//@=> optional grid (no error if not found)
              mandatory: fg.length===1,//@=> optional grid (no error if not found)
              name:fg[fg.length-1],
              grid: proj4.grids[fg[fg.length-1]]//FIXME: grids loading ...
            };
@@ -439,7 +440,7 @@ proj4.Proj = proj4.Class({
        // DGR, 2011-03-20: grids is an array of objects that hold
        // the loaded grids, its name and the mandatory informations of it.
      }
      if (this.datumCode && this.datumCode != 'none') {
      if (this.datumCode && this.datumCode !== 'none') {
        var datumDef = proj4.Datum[this.datumCode];
        if (datumDef) {
          this.datum_params = datumDef.towgs84 ? datumDef.towgs84.split(',') : null;
@@ -448,7 +449,7 @@ proj4.Proj = proj4.Class({
        }
      }
      if (!this.a) {    // do we have an ellipsoid?
          var ellipse = proj4.Ellipsoid[this.ellps] ? proj4.Ellipsoid[this.ellps] : proj4.Ellipsoid['WGS84'];
          var ellipse = proj4.Ellipsoid[this.ellps] ? proj4.Ellipsoid[this.ellps] : proj4.Ellipsoid.WGS84;
          proj4.extend(this, ellipse);
      }
      if (this.rf && !this.b) this.b = (1.0 - 1.0/this.rf) * this.a;
@@ -461,10 +462,10 @@ proj4.Proj = proj4.Class({
      this.es = (this.a2-this.b2)/this.a2;  // e ^ 2
      this.e = Math.sqrt(this.es);        // eccentricity
      if (this.R_A) {
        this.a *= 1. - this.es * (proj4.common.SIXTH + this.es * (proj4.common.RA4 + this.es * proj4.common.RA6));
        this.a *= 1 - this.es * (proj4.common.SIXTH + this.es * (proj4.common.RA4 + this.es * proj4.common.RA6));
        this.a2 = this.a * this.a;
        this.b2 = this.b * this.b;
        this.es = 0.;
        this.es = 0;
      }
      this.ep2=(this.a2-this.b2)/this.b2; // used in geocentric
      if (!this.k0) this.k0 = 1.0;    //default value
+22 −32
Original line number Diff line number Diff line
@@ -76,20 +76,20 @@ var proj4 = {
        
        // Workaround for datum shifts towgs84, if either source or destination projection is not wgs84
        if (source.datum && dest.datum && (
            ((source.datum.datum_type == proj4.common.PJD_3PARAM || source.datum.datum_type == proj4.common.PJD_7PARAM) && dest.datumCode != "WGS84") ||
            ((dest.datum.datum_type == proj4.common.PJD_3PARAM || dest.datum.datum_type == proj4.common.PJD_7PARAM) && source.datumCode != "WGS84"))) {
            ((source.datum.datum_type === proj4.common.PJD_3PARAM || source.datum.datum_type === proj4.common.PJD_7PARAM) && dest.datumCode !== "WGS84") ||
            ((dest.datum.datum_type === proj4.common.PJD_3PARAM || dest.datum.datum_type === proj4.common.PJD_7PARAM) && source.datumCode !== "WGS84"))) {
            var wgs84 = proj4.WGS84;
            this.transform(source, wgs84, point);
            source = wgs84;
        }

        // DGR, 2010/11/12
        if (source.axis!="enu") {
        if (source.axis!=="enu") {
            this.adjust_axis(source,false,point);
        }

        // Transform source points to long/lat, if they aren't already.
        if (source.projName=="longlat") {
        if (source.projName==="longlat") {
            point.x *= proj4.common.D2R;  // convert degrees to radians
            point.y *= proj4.common.D2R;
        } else {
@@ -113,7 +113,7 @@ var proj4 = {
            point.x -= dest.from_greenwich;
        }

        if (dest.projName=="longlat") {
        if (dest.projName==="longlat") {
            // convert radians to decimal degrees
            point.x *= proj4.common.R2D;
            point.y *= proj4.common.R2D;
@@ -126,7 +126,7 @@ var proj4 = {
        }

        // DGR, 2010/11/12
        if (dest.axis!="enu") {
        if (dest.axis!=="enu") {
            this.adjust_axis(dest,true,point);
        }

@@ -148,8 +148,7 @@ var proj4 = {
      }

      // Explicitly skip datum transform by setting 'datum=none' as parameter for either source or dest
      if( source.datum_type == proj4.common.PJD_NODATUM
          || dest.datum_type == proj4.common.PJD_NODATUM) {
      if( source.datum_type === proj4.common.PJD_NODATUM || dest.datum_type === proj4.common.PJD_NODATUM) {
          return point;
      }

@@ -162,9 +161,9 @@ var proj4 = {

      var fallback= source.datum_type;
      // If this datum requires grid shifts, then apply it to geodetic coordinates.
      if( fallback == proj4.common.PJD_GRIDSHIFT )
      if( fallback === proj4.common.PJD_GRIDSHIFT )
      {
          if (this.apply_gridshift( source, 0, point )==0) {
          if (this.apply_gridshift( source, 0, point )===0) {
            source.a = proj4.common.SRS_WGS84_SEMIMAJOR;
            source.es = proj4.common.SRS_WGS84_ESQUARED;
          } else {
@@ -179,7 +178,7 @@ var proj4 = {
              for (var i= 0, l= source.datum_params.length; i<l; i++) {
                wp*= source.datum_params[i];
              }
              if (wp==0.0) {
              if (wp===0.0) {
                source.a = src_a;
                source.es = source.es;
                return point;
@@ -191,18 +190,12 @@ var proj4 = {
          }
      }

      if( dest.datum_type == proj4.common.PJD_GRIDSHIFT )
      {
      if( dest.datum_type === proj4.common.PJD_GRIDSHIFT ){
          dest.a = proj4.common.SRS_WGS84_SEMIMAJOR;
          dest.es = proj4.common.SRS_WGS84_ESQUARED;
      }
      // Do we need to go through geocentric coordinates?
      if (source.es != dest.es || source.a != dest.a
          || fallback == proj4.common.PJD_3PARAM
          || fallback == proj4.common.PJD_7PARAM
          || dest.datum_type == proj4.common.PJD_3PARAM
          || dest.datum_type == proj4.common.PJD_7PARAM)
      {
      if (source.es !== dest.es || source.a !== dest.a || fallback === proj4.common.PJD_3PARAM || fallback === proj4.common.PJD_7PARAM || dest.datum_type === proj4.common.PJD_3PARAM || dest.datum_type === proj4.common.PJD_7PARAM) {
      //DGR: 2012-07-29 : add nadgrids support (end)

        // Convert to geocentric coordinates.
@@ -210,12 +203,12 @@ var proj4 = {
        // CHECK_RETURN;

        // Convert between datums
        if( source.datum_type == proj4.common.PJD_3PARAM || source.datum_type == proj4.common.PJD_7PARAM ) {
        if( source.datum_type === proj4.common.PJD_3PARAM || source.datum_type === proj4.common.PJD_7PARAM ) {
          source.geocentric_to_wgs84(point);
          // CHECK_RETURN;
        }

        if( dest.datum_type == proj4.common.PJD_3PARAM || dest.datum_type == proj4.common.PJD_7PARAM ) {
        if( dest.datum_type === proj4.common.PJD_3PARAM || dest.datum_type === proj4.common.PJD_7PARAM ) {
          dest.geocentric_from_wgs84(point);
          // CHECK_RETURN;
        }
@@ -226,8 +219,7 @@ var proj4 = {
      }

      // Apply grid shift to destination if required
      if( dest.datum_type == proj4.common.PJD_GRIDSHIFT )
      {
      if( dest.datum_type === proj4.common.PJD_GRIDSHIFT ) {
          this.apply_gridshift( dest, 1, point);
          // CHECK_RETURN;
      }
@@ -245,7 +237,7 @@ var proj4 = {
     * DGR: 2012-07-29 addition based on proj4 trunk
     */
    apply_gridshift : function(srs,inverse,point) {
        if (srs.grids==null || srs.grids.length==0) {
        if (srs.grids===null || srs.grids.length===0) {
            return -38;
        }
        var input= {"x":point.x, "y":point.y};
@@ -256,7 +248,7 @@ var proj4 = {
            var gi= srs.grids[i];
            onlyMandatoryGrids= gi.mandatory;
            var ct= gi.grid;
            if (ct==null) {
            if (ct===null) {
                if (gi.mandatory) {
                    this.reportError("unable to find '"+gi.name+"' grid.");
                    return -48;
@@ -265,9 +257,7 @@ var proj4 = {
            } 
            /* skip tables that don't match our point at all.  */
            var epsilon= (Math.abs(ct.del[1])+Math.abs(ct.del[0]))/10000.0;
            if( ct.ll[1]-epsilon>input.y || ct.ll[0]-epsilon>input.x ||
                ct.ll[1]+(ct.lim[1]-1)*ct.del[1]+epsilon<input.y ||
                ct.ll[0]+(ct.lim[0]-1)*ct.del[0]+epsilon<input.x ) {
            if( ct.ll[1]-epsilon>input.y || ct.ll[0]-epsilon>input.x || ct.ll[1]+(ct.lim[1]-1)*ct.del[1]+epsilon<input.y || ct.ll[0]+(ct.lim[0]-1)*ct.del[0]+epsilon<input.x ) {
                continue;
            }
            /* If we have child nodes, check to see if any of them apply. */
@@ -276,7 +266,7 @@ var proj4 = {
            /* load the grid shift info if we don't have it. */
            /* TODO : proj4.grids pre-loaded (as they can be huge ...) */
            /* skip numerical computing error when "null" grid (identity grid): */
            if (gi.name=="null") {
            if (gi.name==="null") {
                output.x= input.x;
                output.y= input.y;
            } else {
@@ -313,9 +303,9 @@ var proj4 = {
        var xin= point.x, yin= point.y, zin= point.z || 0.0;
        var v, t;
        for (var i= 0; i<3; i++) {
            if (denorm && i==2 && point.z===undefined) { continue; }
                 if (i==0) { v= xin; t= 'x'; }
            else if (i==1) { v= yin; t= 'y'; }
            if (denorm && i===2 && point.z===undefined) { continue; }
                 if (i===0) { v= xin; t= 'x'; }
            else if (i===1) { v= yin; t= 'y'; }
            else           { v= zin; t= 'z'; }
            switch(crs.axis[i]) {
            case 'e':
+28 −28
Original line number Diff line number Diff line
@@ -23,11 +23,11 @@ proj4.common = {
  SRS_WGS84_ESQUARED : 0.006694379990141316, //DGR: 2012-07-29

  // ellipoid pj_set_ell.c
  SIXTH : .1666666666666666667, /* 1/6 */
  RA4   : .04722222222222222222, /* 17/360 */
  RA6   : .02215608465608465608, /* 67/3024 */
  RV4   : .06944444444444444444, /* 5/72 */
  RV6   : .04243827160493827160, /* 55/1296 */
  SIXTH : 0.1666666666666666667, /* 1/6 */
  RA4   : 0.04722222222222222222, /* 17/360 */
  RA6   : 0.02215608465608465608, /* 67/3024 */
  RV4   : 0.06944444444444444444, /* 5/72 */
  RV6   : 0.04243827160493827160, /* 55/1296 */

// Function to compute the constant small m which is the radius of
//   a parallel of latitude, phi, divided by the semimajor axis.
@@ -43,23 +43,23 @@ proj4.common = {
// -----------------------------------------------------------------
  tsfnz : function(eccent, phi, sinphi) {
    var con = eccent * sinphi;
    var com = .5 * eccent;
    var com = 0.5 * eccent;
    con = Math.pow(((1.0 - con) / (1.0 + con)), com);
    return (Math.tan(.5 * (this.HALF_PI - phi))/con);
    return (Math.tan(0.5 * (this.HALF_PI - phi))/con);
  },

// Function to compute the latitude angle, phi2, for the inverse of the
//   Lambert Conformal Conic and Polar Stereographic projections.
// ----------------------------------------------------------------
  phi2z : function(eccent, ts) {
    var eccnth = .5 * eccent;
    var eccnth = 0.5 * eccent;
    var con, dphi;
    var phi = this.HALF_PI - 2 * Math.atan(ts);
    for (var i = 0; i <= 15; i++) {
      con = eccent * Math.sin(phi);
      dphi = this.HALF_PI - 2 * Math.atan(ts *(Math.pow(((1.0 - con)/(1.0 + con)),eccnth))) - phi;
      phi += dphi;
      if (Math.abs(dphi) <= .0000000001) return phi;
      if (Math.abs(dphi) <= 0.0000000001) return phi;
    }
    alert("phi2z has NoConvergence");
    return (-9999);
@@ -72,7 +72,7 @@ proj4.common = {
    var con;
    if (eccent > 1.0e-7) {
      con = eccent * sinphi;
      return (( 1.0- eccent * eccent) * (sinphi /(1.0 - con * con) - (.5/eccent)*Math.log((1.0 - con)/(1.0 + con))));
      return (( 1.0- eccent * eccent) * (sinphi /(1.0 - con * con) - (0.5/eccent)*Math.log((1.0 - con)/(1.0 + con))));
    } else {
      return(2.0 * sinphi);
    }
@@ -101,7 +101,7 @@ proj4.common = {
      con = eccent*sin_phi;
      dphi=Math.pow(1.0-con*con,2.0)/(2.0*cos_phi)*(q/(1-eccent*eccent)-sin_phi/(1.0-con*con)+0.5/eccent*Math.log((1.0-con)/(1.0+con)));
      phi+=dphi;
      if (Math.abs(dphi) <= .0000000001) {
      if (Math.abs(dphi) <= 0.0000000001) {
        return phi;
      }
    }
@@ -133,7 +133,7 @@ proj4.common = {
    for (var i=0;i<15;i++){
      dphi=(ml-(e0*phi-e1*Math.sin(2.0*phi)+e2*Math.sin(4.0*phi)-e3*Math.sin(6.0*phi)))/(e0-2.0*e1*Math.cos(2.0*phi)+4.0*e2*Math.cos(4.0*phi)-6.0*e3*Math.cos(6.0*phi));
      phi+=dphi;
      if (Math.abs(dphi) <= .0000000001) {
      if (Math.abs(dphi) <= 0.0000000001) {
        return phi;
      }
    }
@@ -239,7 +239,7 @@ proj4.common = {
  
  //code from the PROJ.4 pj_mlfn.c file;  this may be useful for other projections
  pj_enfn: function(es) {
    var en = new Array();
    var en = [];
    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;
@@ -257,11 +257,11 @@ proj4.common = {
  },
  
  pj_inv_mlfn: function(arg, es, en) {
    var k = 1./(1.-es);
    var k = 1.0/(1.0-es);
    var phi = arg;
    for (var i = proj4.common.MAX_ITER; i ; --i) { /* rarely goes over 2 iterations */
      var s = Math.sin(phi);
      var t = 1. - es * s * s;
      var t = 1.0 - es * s * s;
      //t = this.pj_mlfn(phi, s, Math.cos(phi), en) - arg;
      //phi -= t * (t * Math.sqrt(t)) * k;
      t = (this.pj_mlfn(phi, s, Math.cos(phi), en) - arg) * (t * Math.sqrt(t)) * k;
@@ -383,16 +383,16 @@ proj4.common = {
**	Inverse determines phi to EPS (1e-11) radians, about 1e-6 seconds.
*/
  C00: 1.0,
  C02: .25,
  C04: .046875,
  C06: .01953125,
  C08: .01068115234375,
  C22: .75,
  C44: .46875,
  C46: .01302083333333333333,
  C48: .00712076822916666666,
  C66: .36458333333333333333,
  C68: .00569661458333333333,
  C88: .3076171875  
  C02: 0.25,
  C04: 0.046875,
  C06: 0.01953125,
  C08: 0.01068115234375,
  C22: 0.75,
  C44: 0.46875,
  C46: 0.01302083333333333333,
  C48: 0.00712076822916666666,
  C66: 0.36458333333333333333,
  C68: 0.00569661458333333333,
  C88: 0.3076171875  

};
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ proj4.Datum = {
};

proj4.WGS84 = new proj4.Proj('WGS84');
proj4.Datum['OSB36'] = proj4.Datum['OSGB36']; //as returned from spatialreference.org
proj4.Datum.OSB36 = proj4.Datum.OSGB36; //as returned from spatialreference.org

//lookup table to go from the projection name in WKT to the proj4 projection name
//build this out as required
+19 −19
Original line number Diff line number Diff line
@@ -12,12 +12,12 @@ proj4.datum = proj4.Class({
      for (var i=0; i<proj.datum_params.length; i++) {
        proj.datum_params[i]=parseFloat(proj.datum_params[i]);
      }
      if (proj.datum_params[0] != 0 || proj.datum_params[1] != 0 || proj.datum_params[2] != 0 ) {
      if (proj.datum_params[0] !== 0 || proj.datum_params[1] !== 0 || proj.datum_params[2] !== 0 ) {
        this.datum_type = proj4.common.PJD_3PARAM;
      }
      if (proj.datum_params.length > 3) {
        if (proj.datum_params[3] != 0 || proj.datum_params[4] != 0 ||
            proj.datum_params[5] != 0 || proj.datum_params[6] != 0 ) {
        if (proj.datum_params[3] !== 0 || proj.datum_params[4] !== 0 ||
            proj.datum_params[5] !== 0 || proj.datum_params[6] !== 0 ) {
          this.datum_type = proj4.common.PJD_7PARAM;
          proj.datum_params[3] *= proj4.common.SEC_TO_RAD;
          proj.datum_params[4] *= proj4.common.SEC_TO_RAD;
@@ -45,24 +45,24 @@ proj4.datum = proj4.Class({
  // cs_compare_datums()
  //   Returns TRUE if the two datums match, otherwise FALSE.
  compare_datums : function( dest ) {
    if( this.datum_type != dest.datum_type ) {
    if( this.datum_type !== dest.datum_type ) {
      return false; // false, datums are not equal
    } else if( this.a != dest.a || Math.abs(this.es-dest.es) > 0.000000000050 ) {
    } else if( this.a !== dest.a || Math.abs(this.es-dest.es) > 0.000000000050 ) {
      // the tolerence for es is to ensure that GRS80 and WGS84
      // are considered identical
      return false;
    } else if( this.datum_type == proj4.common.PJD_3PARAM ) {
      return (this.datum_params[0] == dest.datum_params[0]
              && this.datum_params[1] == dest.datum_params[1]
              && this.datum_params[2] == dest.datum_params[2]);
      return (this.datum_params[0] == dest.datum_params[0] &&
              this.datum_params[1] == dest.datum_params[1] &&
              this.datum_params[2] == dest.datum_params[2]);
    } else if( this.datum_type == proj4.common.PJD_7PARAM ) {
      return (this.datum_params[0] == dest.datum_params[0]
              && this.datum_params[1] == dest.datum_params[1]
              && this.datum_params[2] == dest.datum_params[2]
              && this.datum_params[3] == dest.datum_params[3]
              && this.datum_params[4] == dest.datum_params[4]
              && this.datum_params[5] == dest.datum_params[5]
              && this.datum_params[6] == dest.datum_params[6]);
      return (this.datum_params[0] == dest.datum_params[0] &&
              this.datum_params[1] == dest.datum_params[1] &&
              this.datum_params[2] == dest.datum_params[2] &&
              this.datum_params[3] == dest.datum_params[3] &&
              this.datum_params[4] == dest.datum_params[4] &&
              this.datum_params[5] == dest.datum_params[5] &&
              this.datum_params[6] == dest.datum_params[6]);
    } else if ( this.datum_type == proj4.common.PJD_GRIDSHIFT ||
                dest.datum_type == proj4.common.PJD_GRIDSHIFT ) {
      //alert("ERROR: Grid shift transformations are not implemented.");
@@ -187,7 +187,7 @@ var maxiter = 30;

/* --------------------------------------------------------------
 * Following iterative algorithm was developped by
 * "Institut fr Erdmessung", University of Hannover, July 1988.
 * "Institut for Erdmessung", University of Hannover, July 1988.
 * Internet: www.ife.uni-hannover.de
 * Iterative computation of CPHI,SPHI and Height.
 * Iteration of CPHI and SPHI to 10**-12 radian resp.
@@ -262,7 +262,7 @@ var maxiter = 30;
    Z = parseFloat(Z);

    At_Pole = false;
    if (X != 0.0)
    if (X !== 0.0)
    {
        Longitude = Math.atan2(Y,X);
    }
@@ -321,7 +321,7 @@ var maxiter = 30;
    {
        Height = Z / Sin_p1 + Rn * (this.es - 1.0);
    }
    if (At_Pole == false)
    if (At_Pole === false)
    {
        Latitude = Math.atan(Sin_p1 / Cos_p1);
    }
Loading