Loading lib/proj4js-combined.js +91 −2 Original line number Diff line number Diff line Loading @@ -97,6 +97,11 @@ Proj4js = { source = wgs84; } // DGR, 2010/11/12 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") { point.x *= Proj4js.common.D2R; // convert degrees to radians Loading Loading @@ -133,6 +138,12 @@ Proj4js = { point.y /= dest.to_meter; } } // DGR, 2010/11/12 if (dest.axis!="enu") { this.adjust_axis(dest,true,point); } return point; }, // transform() Loading Loading @@ -217,6 +228,50 @@ Proj4js = { return point; }, // cs_datum_transform /** * Function: adjust_axis * Normalize or de-normalized the x/y/z axes. The normal form is "enu" * (easting, northing, up). * Parameters: * crs {Proj4js.Proj} the coordinate reference system * denorm {Boolean} when false, normalize * point {Object} the coordinates to adjust */ adjust_axis: function(crs, denorm, point) { 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'; } else { v= zin; t= 'z'; } switch(crs.axis[i]) { case 'e': point[t]= v; break; case 'w': point[t]= -v; break; case 'n': point[t]= v; break; case 's': point[t]= -v; break; case 'u': if (point[t]!==undefined) { point.z= v; } break; case 'd': if (point[t]!==undefined) { point.z= -v; } break; default : alert("ERROR: unknow axis ("+crs.axis[i]+") - check definition of "+src.projName); return null; } } return point; }, /** * Function: reportError * An internal method to report errors back to user. Loading Loading @@ -317,7 +372,8 @@ Proj4js = { /** * The following properties and methods handle dynamic loading of JSON objects. * */ /** * Property: scriptName * {String} The filename of this script without any path. Loading Loading @@ -788,6 +844,27 @@ Proj4js.Proj = Proj4js.Class({ case 'TOWGS84': this.datum_params = wktArray; break; //DGR 2010-11-12: AXIS case 'AXIS': var name= wktName.toLowerCase(); var value= wktArray.shift(); switch (value) { case 'EAST' : value= 'e'; break; case 'WEST' : value= 'w'; break; case 'NORTH': value= 'n'; break; case 'SOUTH': value= 's'; break; case 'UP' : value= 'u'; break; case 'DOWN' : value= 'd'; break; case 'OTHER': default : value= ' '; break;//FIXME } if (!this.axis) { this.axis= "enu"; } switch(name) { case 'X': this.axis= value + this.axis.substr(1,2); break; case 'Y': this.axis= this.axis.substr(0,1) + value + this.axis.substr(2,1); break; case 'Z': this.axis= this.axis.substr(0,2) + value ; break; default : break; } case 'MORE_HERE': break; default: Loading Loading @@ -852,6 +929,16 @@ Proj4js.Proj = Proj4js.Class({ Proj4js.PrimeMeridian[paramVal] : parseFloat(paramVal); this.from_greenwich *= Proj4js.common.D2R; break; // DGR 2010-11-12: axis case "axis": paramVal = paramVal.replace(/\s/gi,""); var legalAxis= "ewnsud"; 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) { this.axis= paramVal; } //FIXME: be silent ? break case "no_defs": break; default: //alert("Unrecognized parameter: " + paramName); } // switch() Loading Loading @@ -896,6 +983,8 @@ Proj4js.Proj = Proj4js.Class({ } this.ep2=(this.a2-this.b2)/this.b2; // used in geocentric if (!this.k0) this.k0 = 1.0; //default value //DGR 2010-11-12: axis if (!this.axis) { this.axis= "enu"; } this.datum = new Proj4js.datum(this); } Loading Loading @@ -1550,7 +1639,7 @@ Proj4js.Point = Proj4js.Class({ this.x = x[0]; this.y = x[1]; this.z = x[2] || 0.0; } else if (typeof x == 'string') { } else if (typeof x == 'string' && typeof y == 'undefined') { var coords = x.split(','); this.x = parseFloat(coords[0]); this.y = parseFloat(coords[1]); Loading lib/proj4js-compressed.js +19 −4 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
lib/proj4js-combined.js +91 −2 Original line number Diff line number Diff line Loading @@ -97,6 +97,11 @@ Proj4js = { source = wgs84; } // DGR, 2010/11/12 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") { point.x *= Proj4js.common.D2R; // convert degrees to radians Loading Loading @@ -133,6 +138,12 @@ Proj4js = { point.y /= dest.to_meter; } } // DGR, 2010/11/12 if (dest.axis!="enu") { this.adjust_axis(dest,true,point); } return point; }, // transform() Loading Loading @@ -217,6 +228,50 @@ Proj4js = { return point; }, // cs_datum_transform /** * Function: adjust_axis * Normalize or de-normalized the x/y/z axes. The normal form is "enu" * (easting, northing, up). * Parameters: * crs {Proj4js.Proj} the coordinate reference system * denorm {Boolean} when false, normalize * point {Object} the coordinates to adjust */ adjust_axis: function(crs, denorm, point) { 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'; } else { v= zin; t= 'z'; } switch(crs.axis[i]) { case 'e': point[t]= v; break; case 'w': point[t]= -v; break; case 'n': point[t]= v; break; case 's': point[t]= -v; break; case 'u': if (point[t]!==undefined) { point.z= v; } break; case 'd': if (point[t]!==undefined) { point.z= -v; } break; default : alert("ERROR: unknow axis ("+crs.axis[i]+") - check definition of "+src.projName); return null; } } return point; }, /** * Function: reportError * An internal method to report errors back to user. Loading Loading @@ -317,7 +372,8 @@ Proj4js = { /** * The following properties and methods handle dynamic loading of JSON objects. * */ /** * Property: scriptName * {String} The filename of this script without any path. Loading Loading @@ -788,6 +844,27 @@ Proj4js.Proj = Proj4js.Class({ case 'TOWGS84': this.datum_params = wktArray; break; //DGR 2010-11-12: AXIS case 'AXIS': var name= wktName.toLowerCase(); var value= wktArray.shift(); switch (value) { case 'EAST' : value= 'e'; break; case 'WEST' : value= 'w'; break; case 'NORTH': value= 'n'; break; case 'SOUTH': value= 's'; break; case 'UP' : value= 'u'; break; case 'DOWN' : value= 'd'; break; case 'OTHER': default : value= ' '; break;//FIXME } if (!this.axis) { this.axis= "enu"; } switch(name) { case 'X': this.axis= value + this.axis.substr(1,2); break; case 'Y': this.axis= this.axis.substr(0,1) + value + this.axis.substr(2,1); break; case 'Z': this.axis= this.axis.substr(0,2) + value ; break; default : break; } case 'MORE_HERE': break; default: Loading Loading @@ -852,6 +929,16 @@ Proj4js.Proj = Proj4js.Class({ Proj4js.PrimeMeridian[paramVal] : parseFloat(paramVal); this.from_greenwich *= Proj4js.common.D2R; break; // DGR 2010-11-12: axis case "axis": paramVal = paramVal.replace(/\s/gi,""); var legalAxis= "ewnsud"; 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) { this.axis= paramVal; } //FIXME: be silent ? break case "no_defs": break; default: //alert("Unrecognized parameter: " + paramName); } // switch() Loading Loading @@ -896,6 +983,8 @@ Proj4js.Proj = Proj4js.Class({ } this.ep2=(this.a2-this.b2)/this.b2; // used in geocentric if (!this.k0) this.k0 = 1.0; //default value //DGR 2010-11-12: axis if (!this.axis) { this.axis= "enu"; } this.datum = new Proj4js.datum(this); } Loading Loading @@ -1550,7 +1639,7 @@ Proj4js.Point = Proj4js.Class({ this.x = x[0]; this.y = x[1]; this.z = x[2] || 0.0; } else if (typeof x == 'string') { } else if (typeof x == 'string' && typeof y == 'undefined') { var coords = x.split(','); this.x = parseFloat(coords[0]); this.y = parseFloat(coords[1]); Loading
lib/proj4js-compressed.js +19 −4 File changed.Preview size limit exceeded, changes collapsed. Show changes