proj4 2.20.2 → 2.20.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bower.json +1 -1
- package/component.json +1 -1
- package/dist/lib/constants/Datum.d.ts +108 -0
- package/dist/proj4-src.js +239 -148
- package/dist/proj4.js +1 -1
- package/lib/constants/Datum.js +90 -9
- package/lib/parseCode.js +14 -15
- package/lib/projections/krovak.js +1 -1
- package/lib/projections/ortho.js +16 -13
- package/package.json +2 -2
- package/proj.db +0 -0
package/lib/constants/Datum.js
CHANGED
|
@@ -129,7 +129,7 @@ var datums = {
|
|
|
129
129
|
towgs84: '-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166'
|
|
130
130
|
},
|
|
131
131
|
EPSG_4231: {
|
|
132
|
-
towgs84: '-83.11,-97.38,-117.22,0.
|
|
132
|
+
towgs84: '-83.11,-97.38,-117.22,0.005693,-0.044698,0.044285,0.1218'
|
|
133
133
|
},
|
|
134
134
|
EPSG_4274: {
|
|
135
135
|
towgs84: '-230.994,102.591,25.199,0.633,-0.239,0.9,1.95'
|
|
@@ -159,7 +159,7 @@ var datums = {
|
|
|
159
159
|
towgs84: '8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926'
|
|
160
160
|
},
|
|
161
161
|
EPSG_4289: {
|
|
162
|
-
towgs84: '565.7381,50.4018,465.2904,-
|
|
162
|
+
towgs84: '565.7381,50.4018,465.2904,-0.395026,0.330772,-1.876073,4.07244'
|
|
163
163
|
},
|
|
164
164
|
EPSG_4230: {
|
|
165
165
|
towgs84: '-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4'
|
|
@@ -189,7 +189,7 @@ var datums = {
|
|
|
189
189
|
towgs84: '-45,417,-3.5'
|
|
190
190
|
},
|
|
191
191
|
EPSG_4611: {
|
|
192
|
-
towgs84: '-162.619,-276.959,-161.764,0.067753,-2.
|
|
192
|
+
towgs84: '-162.619,-276.959,-161.764,0.067753,-2.243648,-1.158828,-1.094246'
|
|
193
193
|
},
|
|
194
194
|
EPSG_4633: {
|
|
195
195
|
towgs84: '137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824'
|
|
@@ -207,7 +207,7 @@ var datums = {
|
|
|
207
207
|
towgs84: '482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15'
|
|
208
208
|
},
|
|
209
209
|
EPSG_4660: {
|
|
210
|
-
towgs84: '982.6087,552.753,-540.873,
|
|
210
|
+
towgs84: '982.6087,552.753,-540.873,6.681627,-31.611492,-19.848161,16.805'
|
|
211
211
|
},
|
|
212
212
|
EPSG_4662: {
|
|
213
213
|
towgs84: '97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259'
|
|
@@ -237,7 +237,7 @@ var datums = {
|
|
|
237
237
|
towgs84: '217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093'
|
|
238
238
|
},
|
|
239
239
|
EPSG_9333: {
|
|
240
|
-
towgs84: '0,0,0,-
|
|
240
|
+
towgs84: '0,0,0,-0.008393,0.000749,-0.010276,0'
|
|
241
241
|
},
|
|
242
242
|
EPSG_9059: {
|
|
243
243
|
towgs84: '0,0,0'
|
|
@@ -393,7 +393,7 @@ var datums = {
|
|
|
393
393
|
towgs84: '674.374,15.056,405.346'
|
|
394
394
|
},
|
|
395
395
|
EPSG_4617: {
|
|
396
|
-
towgs84: '-0.991,1.9072,0.5129,
|
|
396
|
+
towgs84: '-0.991,1.9072,0.5129,0.02579,0.00965,0.01166,0'
|
|
397
397
|
},
|
|
398
398
|
EPSG_4663: {
|
|
399
399
|
towgs84: '-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485'
|
|
@@ -456,10 +456,10 @@ var datums = {
|
|
|
456
456
|
towgs84: '275.57,676.78,229.6'
|
|
457
457
|
},
|
|
458
458
|
EPSG_4283: {
|
|
459
|
-
towgs84: '
|
|
459
|
+
towgs84: '0.06155,-0.01087,-0.04019,0.039492,0.032722,0.032898,-0.009994'
|
|
460
460
|
},
|
|
461
461
|
EPSG_4317: {
|
|
462
|
-
towgs84: '2.3287,-147.0425,-92.0802,-0.
|
|
462
|
+
towgs84: '2.3287,-147.0425,-92.0802,-0.309248,0.324822,0.497299,5.689063'
|
|
463
463
|
},
|
|
464
464
|
EPSG_4272: {
|
|
465
465
|
towgs84: '59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993'
|
|
@@ -582,7 +582,7 @@ var datums = {
|
|
|
582
582
|
towgs84: '-208.4058,-109.8777,-2.5764'
|
|
583
583
|
},
|
|
584
584
|
ESRI_104101: {
|
|
585
|
-
towgs84: '
|
|
585
|
+
towgs84: '372.87,149.23,585.29'
|
|
586
586
|
},
|
|
587
587
|
EPSG_4693: {
|
|
588
588
|
towgs84: '0,-0.15,0.68'
|
|
@@ -1267,6 +1267,87 @@ var datums = {
|
|
|
1267
1267
|
},
|
|
1268
1268
|
EPSG_4818: {
|
|
1269
1269
|
towgs84: '589,76,480'
|
|
1270
|
+
},
|
|
1271
|
+
EPSG_10328: {
|
|
1272
|
+
towgs84: '0,0,0'
|
|
1273
|
+
},
|
|
1274
|
+
EPSG_9782: {
|
|
1275
|
+
towgs84: '0,0,0'
|
|
1276
|
+
},
|
|
1277
|
+
EPSG_9777: {
|
|
1278
|
+
towgs84: '0,0,0'
|
|
1279
|
+
},
|
|
1280
|
+
EPSG_10690: {
|
|
1281
|
+
towgs84: '0,0,0'
|
|
1282
|
+
},
|
|
1283
|
+
EPSG_10639: {
|
|
1284
|
+
towgs84: '0,0,0'
|
|
1285
|
+
},
|
|
1286
|
+
EPSG_10739: {
|
|
1287
|
+
towgs84: '0,0,0'
|
|
1288
|
+
},
|
|
1289
|
+
EPSG_7686: {
|
|
1290
|
+
towgs84: '0,0,0'
|
|
1291
|
+
},
|
|
1292
|
+
EPSG_8900: {
|
|
1293
|
+
towgs84: '0,0,0'
|
|
1294
|
+
},
|
|
1295
|
+
EPSG_5886: {
|
|
1296
|
+
towgs84: '0,0,0'
|
|
1297
|
+
},
|
|
1298
|
+
EPSG_7683: {
|
|
1299
|
+
towgs84: '0,0,0'
|
|
1300
|
+
},
|
|
1301
|
+
EPSG_6668: {
|
|
1302
|
+
towgs84: '0,0,0'
|
|
1303
|
+
},
|
|
1304
|
+
EPSG_20046: {
|
|
1305
|
+
towgs84: '0,0,0'
|
|
1306
|
+
},
|
|
1307
|
+
EPSG_10299: {
|
|
1308
|
+
towgs84: '0,0,0'
|
|
1309
|
+
},
|
|
1310
|
+
EPSG_10310: {
|
|
1311
|
+
towgs84: '0,0,0'
|
|
1312
|
+
},
|
|
1313
|
+
EPSG_10475: {
|
|
1314
|
+
towgs84: '0,0,0'
|
|
1315
|
+
},
|
|
1316
|
+
EPSG_4742: {
|
|
1317
|
+
towgs84: '0,0,0'
|
|
1318
|
+
},
|
|
1319
|
+
EPSG_10671: {
|
|
1320
|
+
towgs84: '0,0,0'
|
|
1321
|
+
},
|
|
1322
|
+
EPSG_10762: {
|
|
1323
|
+
towgs84: '0,0,0'
|
|
1324
|
+
},
|
|
1325
|
+
EPSG_10725: {
|
|
1326
|
+
towgs84: '0,0,0'
|
|
1327
|
+
},
|
|
1328
|
+
EPSG_10791: {
|
|
1329
|
+
towgs84: '0,0,0'
|
|
1330
|
+
},
|
|
1331
|
+
EPSG_10800: {
|
|
1332
|
+
towgs84: '0,0,0'
|
|
1333
|
+
},
|
|
1334
|
+
EPSG_10305: {
|
|
1335
|
+
towgs84: '0,0,0'
|
|
1336
|
+
},
|
|
1337
|
+
EPSG_10941: {
|
|
1338
|
+
towgs84: '0,0,0'
|
|
1339
|
+
},
|
|
1340
|
+
EPSG_10968: {
|
|
1341
|
+
towgs84: '0,0,0'
|
|
1342
|
+
},
|
|
1343
|
+
EPSG_10875: {
|
|
1344
|
+
towgs84: '0,0,0'
|
|
1345
|
+
},
|
|
1346
|
+
EPSG_6318: {
|
|
1347
|
+
towgs84: '0,0,0'
|
|
1348
|
+
},
|
|
1349
|
+
EPSG_10910: {
|
|
1350
|
+
towgs84: '0,0,0'
|
|
1270
1351
|
}
|
|
1271
1352
|
};
|
|
1272
1353
|
|
package/lib/parseCode.js
CHANGED
|
@@ -13,6 +13,9 @@ function testWKT(code) {
|
|
|
13
13
|
}
|
|
14
14
|
var codes = ['3857', '900913', '3785', '102113'];
|
|
15
15
|
function checkMercator(item) {
|
|
16
|
+
if (item.title) {
|
|
17
|
+
return item.title.toLowerCase().indexOf('epsg:') === 0 && codes.indexOf(item.title.substr(5)) > -1;
|
|
18
|
+
}
|
|
16
19
|
var auth = match(item, 'authority');
|
|
17
20
|
if (!auth) {
|
|
18
21
|
return;
|
|
@@ -35,31 +38,27 @@ function testProj(code) {
|
|
|
35
38
|
* @returns {import('./defs').ProjectionDefinition}
|
|
36
39
|
*/
|
|
37
40
|
function parse(code) {
|
|
41
|
+
let out;
|
|
38
42
|
if (testObj(code)) {
|
|
39
43
|
// check to see if this is a WKT string
|
|
40
44
|
if (testDef(code)) {
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
var out = wkt(code);
|
|
45
|
-
// test of spetial case, due to this being a very common and often malformed
|
|
46
|
-
if (checkMercator(out)) {
|
|
47
|
-
return defs['EPSG:3857'];
|
|
48
|
-
}
|
|
45
|
+
out = defs[code];
|
|
46
|
+
} else if (testWKT(code)) {
|
|
47
|
+
out = wkt(code);
|
|
49
48
|
var maybeProjStr = checkProjStr(out);
|
|
50
49
|
if (maybeProjStr) {
|
|
51
|
-
|
|
50
|
+
out = projStr(maybeProjStr);
|
|
52
51
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (testProj(code)) {
|
|
56
|
-
return projStr(code);
|
|
52
|
+
} else if (testProj(code)) {
|
|
53
|
+
out = projStr(code);
|
|
57
54
|
}
|
|
58
55
|
} else if (!('projName' in code)) {
|
|
59
|
-
|
|
56
|
+
out = wkt(code);
|
|
60
57
|
} else {
|
|
61
|
-
|
|
58
|
+
out = code;
|
|
62
59
|
}
|
|
60
|
+
// test for special Web Mercator case, due to this being a very common and often malformed
|
|
61
|
+
return out && checkMercator(out) ? defs['EPSG:3857'] : out;
|
|
63
62
|
}
|
|
64
63
|
|
|
65
64
|
export default parse;
|
|
@@ -97,7 +97,7 @@ export function inverse(p) {
|
|
|
97
97
|
return (p);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
export var names = ['Krovak', 'krovak'];
|
|
100
|
+
export var names = ['Krovak', 'Krovak Modified', 'Krovak (North Orientated)', 'Krovak Modified (North Orientated)', 'krovak'];
|
|
101
101
|
export default {
|
|
102
102
|
init: init,
|
|
103
103
|
forward: forward,
|
package/lib/projections/ortho.js
CHANGED
|
@@ -14,8 +14,8 @@ export function init() {
|
|
|
14
14
|
|
|
15
15
|
/* Place parameters in static storage for common use
|
|
16
16
|
------------------------------------------------- */
|
|
17
|
-
this.sin_p14 = Math.sin(this.lat0);
|
|
18
|
-
this.cos_p14 = Math.cos(this.lat0);
|
|
17
|
+
this.sin_p14 = Math.sin(this.lat0 || 0);
|
|
18
|
+
this.cos_p14 = Math.cos(this.lat0 || 0);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/* Orthographic forward equations--mapping lat,long to x,y
|
|
@@ -30,7 +30,7 @@ export function forward(p) {
|
|
|
30
30
|
var lat = p.y;
|
|
31
31
|
/* Forward equations
|
|
32
32
|
----------------- */
|
|
33
|
-
dlon = adjust_lon(lon - this.long0, this.over);
|
|
33
|
+
dlon = adjust_lon(lon - (this.long0 || 0), this.over);
|
|
34
34
|
|
|
35
35
|
sinphi = Math.sin(lat);
|
|
36
36
|
cosphi = Math.cos(lat);
|
|
@@ -40,7 +40,7 @@ export function forward(p) {
|
|
|
40
40
|
ksp = 1;
|
|
41
41
|
if ((g > 0) || (Math.abs(g) <= EPSLN)) {
|
|
42
42
|
x = this.a * ksp * cosphi * Math.sin(dlon);
|
|
43
|
-
y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);
|
|
43
|
+
y = (this.y0 || 0) + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);
|
|
44
44
|
}
|
|
45
45
|
p.x = x;
|
|
46
46
|
p.y = y;
|
|
@@ -53,36 +53,39 @@ export function inverse(p) {
|
|
|
53
53
|
var sinz, cosz; /* sin of z and cos of z */
|
|
54
54
|
var con;
|
|
55
55
|
var lon, lat;
|
|
56
|
+
var long0, lat0;
|
|
56
57
|
/* Inverse equations
|
|
57
58
|
----------------- */
|
|
58
|
-
p.x -= this.x0;
|
|
59
|
-
p.y -= this.y0;
|
|
59
|
+
p.x -= this.x0 || 0;
|
|
60
|
+
p.y -= this.y0 || 0;
|
|
60
61
|
rh = Math.sqrt(p.x * p.x + p.y * p.y);
|
|
61
62
|
z = asinz(rh / this.a);
|
|
62
63
|
|
|
63
64
|
sinz = Math.sin(z);
|
|
64
65
|
cosz = Math.cos(z);
|
|
65
66
|
|
|
66
|
-
|
|
67
|
+
long0 = this.long0 || 0;
|
|
68
|
+
lat0 = this.lat0 || 0;
|
|
69
|
+
lon = long0;
|
|
67
70
|
if (Math.abs(rh) <= EPSLN) {
|
|
68
|
-
lat =
|
|
71
|
+
lat = lat0;
|
|
69
72
|
p.x = lon;
|
|
70
73
|
p.y = lat;
|
|
71
74
|
return p;
|
|
72
75
|
}
|
|
73
76
|
lat = asinz(cosz * this.sin_p14 + (p.y * sinz * this.cos_p14) / rh);
|
|
74
|
-
con = Math.abs(
|
|
77
|
+
con = Math.abs(lat0) - HALF_PI;
|
|
75
78
|
if (Math.abs(con) <= EPSLN) {
|
|
76
|
-
if (
|
|
77
|
-
lon = adjust_lon(
|
|
79
|
+
if (lat0 >= 0) {
|
|
80
|
+
lon = adjust_lon(long0 + Math.atan2(p.x, -p.y), this.over);
|
|
78
81
|
} else {
|
|
79
|
-
lon = adjust_lon(
|
|
82
|
+
lon = adjust_lon(long0 - Math.atan2(-p.x, p.y), this.over);
|
|
80
83
|
}
|
|
81
84
|
p.x = lon;
|
|
82
85
|
p.y = lat;
|
|
83
86
|
return p;
|
|
84
87
|
}
|
|
85
|
-
lon = adjust_lon(
|
|
88
|
+
lon = adjust_lon(long0 + Math.atan2((p.x * sinz), rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz), this.over);
|
|
86
89
|
p.x = lon;
|
|
87
90
|
p.y = lat;
|
|
88
91
|
return p;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "proj4",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.4",
|
|
4
4
|
"description": "Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.",
|
|
5
5
|
"homepage": "https://proj4js.github.io/proj4js/",
|
|
6
6
|
"main": "dist/proj4-src.js",
|
|
@@ -48,6 +48,6 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"mgrs": "1.0.0",
|
|
51
|
-
"wkt-parser": "^1.5.
|
|
51
|
+
"wkt-parser": "^1.5.3"
|
|
52
52
|
}
|
|
53
53
|
}
|
package/proj.db
ADDED
|
Binary file
|