Comparing version 1.5.0-dev.2 to 1.5.0-dev.3
{ | ||
"name": "proj4", | ||
"version": "1.5.0-dev.2", | ||
"version": "1.5.0-dev.3", | ||
"homepage": "https://github.com/proj4js/proj4js", | ||
@@ -5,0 +5,0 @@ "description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.", |
@@ -5,3 +5,3 @@ { | ||
"description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.", | ||
"version": "1.5.0-dev.2", | ||
"version": "1.5.0-dev.3", | ||
"keywords": ["projections","proj4","transform","crs"], | ||
@@ -8,0 +8,0 @@ "license": "MIT", |
@@ -61,6 +61,3 @@ module.exports = function(grunt) { | ||
}); | ||
grunt.registerTask('amd', ['jshint', 'requirejs:amd', 'connect', 'mocha_phantomjs:amd']); | ||
grunt.registerTask('build', ['jshint', 'requirejs:custom']); | ||
grunt.registerTask('default', ['version', 'jshint', 'browserify', 'uglify', 'connect','mocha_phantomjs:after', 'mocha_phantomjs:amd']); | ||
}; |
@@ -162,14 +162,2 @@ /* | ||
/** | ||
* Converts between lat/lon and MGRS coordinates. Note that this static class | ||
* is restricted to the WGS84 ellipsoid and does not support MGRS notations | ||
* for polar regions (i.e. above 84° North and below 80° South). | ||
* | ||
* If . is loaded, this will be referenced as util.MGRS. If used | ||
* standalone, it will be referenced as window.MGRS. | ||
* | ||
* @static | ||
*/ | ||
/** | ||
* UTM zones are grouped, and assigned to one of a group of 6 | ||
@@ -176,0 +164,0 @@ * sets. |
var extend = require('./extend'); | ||
var common = require('./common'); | ||
var defs = require('./defs'); | ||
var constants = require('./constants'); | ||
var constants = require('./constants/index'); | ||
var datum = require('./datum'); | ||
var projections = require('./projections'); | ||
var projections = require('./projections/index'); | ||
var wkt = require('./wkt'); | ||
@@ -8,0 +8,0 @@ var projStr = require('./projString'); |
@@ -5,3 +5,2 @@ var common = require('../common'); | ||
if (Math.abs(this.lat1 + this.lat2) < common.EPSLN) { | ||
//...reportError("aeaInitEqualLatitudes"); | ||
return; | ||
@@ -117,5 +116,4 @@ } | ||
} | ||
//...reportError("aea:phi1z:Convergence error"); | ||
return null; | ||
}; | ||
exports.names = ["Albers_Conic_Equal_Area", "Albers", "aea"]; |
@@ -99,3 +99,2 @@ var common = require('../common'); | ||
if (rh > (2 * common.HALF_PI * this.a)) { | ||
//...reportError("aeqdInvDataError"); | ||
return; | ||
@@ -102,0 +101,0 @@ } |
@@ -28,3 +28,2 @@ var common = require('../common'); | ||
this.ns = this.sinphi; | ||
//...reportError("eqdc:Init:EqualLatitudes"); | ||
} | ||
@@ -31,0 +30,0 @@ else { |
@@ -41,3 +41,2 @@ var common = require('../common'); | ||
if (Math.abs(lat) > common.HALF_PI) { | ||
//...reportError("equi:Inv:DataError"); | ||
} | ||
@@ -44,0 +43,0 @@ var lon = common.adjust_lon(this.long0 + p.x / (this.a * Math.cos(this.lat0))); |
@@ -36,3 +36,2 @@ var common = require('../common'); | ||
if (!i) { | ||
//...reportError("gauss:inverse:convergence failed"); | ||
return null; | ||
@@ -44,2 +43,2 @@ } | ||
}; | ||
exports.names = ["gauss"]; | ||
exports.names = ["gauss"]; |
@@ -46,3 +46,2 @@ var common = require('../common'); | ||
else { | ||
//...reportError("orthoFwdPointError"); | ||
@@ -49,0 +48,0 @@ // Point is in the opposing hemisphere and is unprojectable |
var common = require('../common'); | ||
exports.init = function() { | ||
/* we want Bessel as fixed ellipsoid */ | ||
this.a = 6377397.155; | ||
this.es = 0.006674372230614; | ||
this.e = Math.sqrt(this.es); | ||
/* if latitude of projection center is not set, use 49d30'N */ | ||
if (!this.lat0) { | ||
@@ -20,10 +18,7 @@ this.lat0 = 0.863937979737193; | ||
this.s90 = 2 * this.s45; | ||
this.fi0 = this.lat0; /* Latitude of projection centre 49 30' */ | ||
/* Ellipsoid Bessel 1841 a = 6377397.155m 1/f = 299.1528128, | ||
e2=0.006674372230614; | ||
*/ | ||
this.e2 = this.es; /* 0.006674372230614; */ | ||
this.fi0 = this.lat0; | ||
this.e2 = this.es; | ||
this.e = Math.sqrt(this.e2); | ||
this.alfa = Math.sqrt(1 + (this.e2 * Math.pow(Math.cos(this.fi0), 4)) / (1 - this.e2)); | ||
this.uq = 1.04216856380474; /* DU(2, 59, 42, 42.69689) */ | ||
this.uq = 1.04216856380474; | ||
this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa); | ||
@@ -34,3 +29,3 @@ this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2); | ||
this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2)); | ||
this.s0 = 1.37008346281555; /* Latitude of pseudo standard parallel 78 30'00" N */ | ||
this.s0 = 1.37008346281555; | ||
this.n = Math.sin(this.s0); | ||
@@ -48,3 +43,3 @@ this.ro0 = this.k1 * this.n0 / Math.tan(this.s0); | ||
var lat = p.y; | ||
var delta_lon = common.adjust_lon(lon - this.long0); // Delta longitude | ||
var delta_lon = common.adjust_lon(lon - this.long0); | ||
/* Transformation */ | ||
@@ -58,5 +53,2 @@ gfi = Math.pow(((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat))), (this.alfa * this.e / 2)); | ||
ro = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n); | ||
/* x and y are reverted! */ | ||
//p.y = ro * Math.cos(eps) / a; | ||
//p.x = ro * Math.sin(eps) / a; | ||
p.y = ro * Math.cos(eps) / 1; | ||
@@ -74,3 +66,2 @@ p.x = ro * Math.sin(eps) / 1; | ||
exports.inverse = function(p) { | ||
/* Constants, identisch wie in der Umkehrfunktion */ | ||
var u, deltav, s, d, eps, ro, fi1; | ||
@@ -95,3 +86,2 @@ var ok; | ||
p.x = this.long0 - deltav / this.alfa; | ||
/* ITERATION FOR lat */ | ||
fi1 = u; | ||
@@ -109,4 +99,2 @@ ok = 0; | ||
if (iter >= 15) { | ||
//...reportError("PHI3Z-CONV:Latitude failed to converge after 15 iterations"); | ||
//console.log('iter:', iter); | ||
return null; | ||
@@ -117,2 +105,2 @@ } | ||
}; | ||
exports.names = ["Krovak", "krovak"]; | ||
exports.names = ["Krovak", "krovak"]; |
@@ -84,3 +84,2 @@ var common = require('../common'); | ||
if (y <= common.EPSLN) { | ||
//...reportError("laea:fwd:y less than eps"); | ||
return null; | ||
@@ -97,3 +96,2 @@ } | ||
if (Math.abs(phi + this.phi0) < common.EPSLN) { | ||
//...reportError("laea:fwd:phi < eps"); | ||
return null; | ||
@@ -136,3 +134,2 @@ } | ||
if (Math.abs(b) < common.EPSLN) { | ||
//...reportError("laea:fwd:b < eps"); | ||
return null; | ||
@@ -165,19 +162,2 @@ } | ||
//v 1 | ||
/* | ||
var sin_lat=Math.sin(lat); | ||
var cos_lat=Math.cos(lat); | ||
var sin_delta_lon=Math.sin(delta_lon); | ||
var cos_delta_lon=Math.cos(delta_lon); | ||
var g =this.sin_lat_o * sin_lat +this.cos_lat_o * cos_lat * cos_delta_lon; | ||
if (g == -1) { | ||
//...reportError("laea:fwd:Point projects to a circle of radius "+ 2 * R); | ||
return null; | ||
} | ||
var ksp = this.a * Math.sqrt(2 / (1 + g)); | ||
var x = ksp * cos_lat * sin_delta_lon + this.x0; | ||
var y = ksp * (this.cos_lat_o * sin_lat - this.sin_lat_o * cos_lat * cos_delta_lon) + this.y0; | ||
*/ | ||
p.x = this.a * x + this.x0; | ||
@@ -204,3 +184,2 @@ p.y = this.a * y + this.y0; | ||
if (phi > 1) { | ||
//...reportError("laea:Inv:DataError"); | ||
return null; | ||
@@ -269,5 +248,2 @@ } | ||
} | ||
/* | ||
q = this.qp - q; | ||
*/ | ||
ab = 1 - q / this.qp; | ||
@@ -282,36 +258,7 @@ if (this.mode === this.S_POLE) { | ||
/* | ||
var Rh = Math.Math.sqrt(p.x *p.x +p.y * p.y); | ||
var temp = Rh / (2 * this.a); | ||
if (temp > 1) { | ||
...reportError("laea:Inv:DataError"); | ||
return null; | ||
} | ||
var z = 2 * common.asinz(temp); | ||
var sin_z=Math.sin(z); | ||
var cos_z=Math.cos(z); | ||
var lon =this.long0; | ||
if (Math.abs(Rh) > common.EPSLN) { | ||
var lat = common.asinz(this.sin_lat_o * cos_z +this. cos_lat_o * sin_z *p.y / Rh); | ||
var temp =Math.abs(this.lat0) - common.HALF_PI; | ||
if (Math.abs(temp) > common.EPSLN) { | ||
temp = cos_z -this.sin_lat_o * Math.sin(lat); | ||
if(temp!=0) lon=common.adjust_lon(this.long0+Math.atan2(p.x*sin_z*this.cos_lat_o,temp*Rh)); | ||
} else if (this.lat0 < 0) { | ||
lon = common.adjust_lon(this.long0 - Math.atan2(-p.x,p.y)); | ||
} else { | ||
lon = common.adjust_lon(this.long0 + Math.atan2(p.x, -p.y)); | ||
} | ||
} else { | ||
lat = this.lat0; | ||
} | ||
*/ | ||
//return(OK); | ||
p.x = common.adjust_lon(this.long0 + lam); | ||
p.y = phi; | ||
return p; | ||
}; //lamazInv() | ||
}; | ||
@@ -318,0 +265,0 @@ /* determine latitude from authalic latitude */ |
@@ -23,3 +23,2 @@ var common = require('../common'); | ||
if (Math.abs(this.lat1 + this.lat2) < common.EPSLN) { | ||
//...reportError("lcc:init: Equal Latitudes"); | ||
return; | ||
@@ -81,3 +80,2 @@ } | ||
if (con <= 0) { | ||
//...reportError("lcc:forward: No Projection"); | ||
return null; | ||
@@ -84,0 +82,0 @@ } |
@@ -30,3 +30,2 @@ var common = require('../common'); | ||
exports.forward = function(p) { | ||
//alert("ll2m coords : "+coords); | ||
var lon = p.x; | ||
@@ -36,3 +35,2 @@ var lat = p.y; | ||
if (lat * common.R2D > 90 && lat * common.R2D < -90 && lon * common.R2D > 180 && lon * common.R2D < -180) { | ||
//...reportError("merc:forward: llInputOutOfRange: " + lon + " : " + lat); | ||
return null; | ||
@@ -43,3 +41,2 @@ } | ||
if (Math.abs(Math.abs(lat) - common.HALF_PI) <= common.EPSLN) { | ||
//...reportError("merc:forward: ll2mAtPoles"); | ||
return null; | ||
@@ -80,3 +77,2 @@ } | ||
if (lat === -9999) { | ||
//...reportError("merc:inverse: lat = -9999"); | ||
return null; | ||
@@ -83,0 +79,0 @@ } |
var common = require('../common'); | ||
exports.init = function() { | ||
//no-op | ||
}; | ||
exports.init = function() {}; | ||
@@ -27,6 +25,2 @@ /* Mollweide forward equations--mapping lat,long to x,y | ||
} | ||
if (i >= 50) { | ||
//...reportError("moll:Fwd:IterationError"); | ||
//return(241); | ||
} | ||
} | ||
@@ -78,3 +72,2 @@ theta /= 2; | ||
var lat = Math.asin(arg); | ||
//return(OK); | ||
@@ -85,2 +78,2 @@ p.x = lon; | ||
}; | ||
exports.names = ["Mollweide", "moll"]; | ||
exports.names = ["Mollweide", "moll"]; |
@@ -36,5 +36,2 @@ var common = require('../common'); | ||
} | ||
else { | ||
//...reportError("orthoFwdPointError"); | ||
} | ||
p.x = x; | ||
@@ -57,5 +54,2 @@ p.y = y; | ||
rh = Math.sqrt(p.x * p.x + p.y * p.y); | ||
if (rh > this.a + 0.0000001) { | ||
//...reportError("orthoInvDataError"); | ||
} | ||
z = common.asinz(rh / this.a); | ||
@@ -91,2 +85,2 @@ | ||
}; | ||
exports.names = ["ortho"]; | ||
exports.names = ["ortho"]; |
@@ -6,3 +6,2 @@ var common = require('../common'); | ||
if (!this.rc) { | ||
//...reportError("sterea:init:E_ERROR_0"); | ||
return; | ||
@@ -20,3 +19,3 @@ } | ||
var sinc, cosc, cosl, k; | ||
p.x = common.adjust_lon(p.x - this.long0); /* adjust del longitude */ | ||
p.x = common.adjust_lon(p.x - this.long0); | ||
gauss.forward.apply(this, [p]); | ||
@@ -36,3 +35,3 @@ sinc = Math.sin(p.y); | ||
var sinc, cosc, lon, lat, rho; | ||
p.x = (p.x - this.x0) / this.a; /* descale and de-offset */ | ||
p.x = (p.x - this.x0) / this.a; | ||
p.y = (p.y - this.y0) / this.a; | ||
@@ -57,6 +56,6 @@ | ||
gauss.inverse.apply(this, [p]); | ||
p.x = common.adjust_lon(p.x + this.long0); /* adjust longitude to CM */ | ||
p.x = common.adjust_lon(p.x + this.long0); | ||
return p; | ||
}; | ||
exports.names = ["Stereographic_North_Pole", "Oblique_Stereographic", "Polar_Stereographic", "sterea"]; | ||
exports.names = ["Stereographic_North_Pole", "Oblique_Stereographic", "Polar_Stereographic", "sterea","Oblique Stereographic Alternative"]; |
@@ -18,4 +18,4 @@ var common = require('../common'); | ||
var delta_lon = common.adjust_lon(lon - this.long0); // Delta longitude | ||
var con; // cone constant | ||
var delta_lon = common.adjust_lon(lon - this.long0); | ||
var con; | ||
var x, y; | ||
@@ -25,6 +25,5 @@ var sin_phi = Math.sin(lat); | ||
if (this.sphere) { /* spherical form */ | ||
if (this.sphere) { | ||
var b = cos_phi * Math.sin(delta_lon); | ||
if ((Math.abs(Math.abs(b) - 1)) < 0.0000000001) { | ||
//...reportError("tmerc:forward: Point projects into infinity"); | ||
return (93); | ||
@@ -64,9 +63,9 @@ } | ||
exports.inverse = function(p) { | ||
var con, phi; /* temporary angles */ | ||
var delta_phi; /* difference between longitudes */ | ||
var con, phi; | ||
var delta_phi; | ||
var i; | ||
var max_iter = 6; /* maximun number of iterations */ | ||
var max_iter = 6; | ||
var lat, lon; | ||
if (this.sphere) { /* spherical form */ | ||
if (this.sphere) { | ||
var f = Math.exp(p.x / (this.a * this.k0)); | ||
@@ -101,3 +100,2 @@ var g = 0.5 * (f - 1 / f); | ||
if (i >= max_iter) { | ||
//...reportError("tmerc:inverse: Latitude failed to converge"); | ||
return (95); | ||
@@ -107,3 +105,2 @@ } | ||
if (Math.abs(phi) < common.HALF_PI) { | ||
// sincos(phi, &sin_phi, &cos_phi); | ||
var sin_phi = Math.sin(phi); | ||
@@ -110,0 +107,0 @@ var cos_phi = Math.cos(phi); |
@@ -6,3 +6,2 @@ var common = require('../common'); | ||
if (!this.zone) { | ||
//...reportError("utm:init: zone must be specified for UTM"); | ||
return; | ||
@@ -20,2 +19,2 @@ } | ||
}; | ||
exports.names = ["Universal Transverse Mercator System", "utm"]; | ||
exports.names = ["Universal Transverse Mercator System", "utm"]; |
var common = require('./common'); | ||
var constants = require('./constants'); | ||
var constants = require('./constants/index'); | ||
module.exports = function(defData) { | ||
@@ -116,2 +116,2 @@ var self = {}; | ||
return self; | ||
}; | ||
}; |
@@ -1,1 +0,1 @@ | ||
module.exports = '1.5.0-dev.2'; | ||
module.exports = '1.5.0-dev.3'; |
{ | ||
"name": "proj4", | ||
"version": "1.5.0-dev.2", | ||
"version": "1.5.0-dev.3", | ||
"description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
460225
11408