dgeoutils 2.4.31 → 2.4.33
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/dist/cjs/InterpolationMatrix.d.ts +2 -1
- package/dist/cjs/InterpolationMatrix.js +21 -11
- package/dist/es2015/InterpolationMatrix.js +21 -2
- package/dist/esm/InterpolationMatrix.js +21 -11
- package/dist/umd/dgeoutils.js +50 -40
- package/dist/umd/dgeoutils.min.js +1 -1
- package/dist/umd/dgeoutils.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,12 +10,13 @@ export declare class InterpolationMatrix {
|
|
|
10
10
|
private allCells;
|
|
11
11
|
private readonly sizePoly;
|
|
12
12
|
private readonly keys;
|
|
13
|
+
readonly size: DPoint;
|
|
13
14
|
constructor(bboxLike: DPolygon, stepSize: number, keys: string[] | string, p?: number);
|
|
14
15
|
setKnownPoints(points: DPoint[] | DPolygon): InterpolationMatrix;
|
|
15
16
|
positionToCellCoords(d: DPoint): DPoint;
|
|
16
17
|
calculate(): InterpolationMatrix;
|
|
17
18
|
getCellValue({ x, y }: DPoint, key?: string | string[]): (number | Record<string, number>);
|
|
18
|
-
get
|
|
19
|
+
get getCellData(): Record<number, Record<number, Record<string, number>>>;
|
|
19
20
|
get allCellsClone(): DPolygon[];
|
|
20
21
|
private interpolateValues;
|
|
21
22
|
private setKnownValues;
|
|
@@ -10,6 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
13
24
|
var __read = (this && this.__read) || function (o, n) {
|
|
14
25
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
26
|
if (!m) return o;
|
|
@@ -26,15 +37,6 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
26
37
|
}
|
|
27
38
|
return ar;
|
|
28
39
|
};
|
|
29
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
30
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
31
|
-
if (ar || !(i in from)) {
|
|
32
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
33
|
-
ar[i] = from[i];
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
37
|
-
};
|
|
38
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
41
|
exports.InterpolationMatrix = void 0;
|
|
40
42
|
var DPolygon_1 = require("./DPolygon");
|
|
@@ -51,6 +53,9 @@ var InterpolationMatrix = (function () {
|
|
|
51
53
|
this.minPoint = bboxLike.leftTop;
|
|
52
54
|
this.maxPoint = bboxLike.rightBottom;
|
|
53
55
|
this.sizePoly = DPolygon_1.DPolygon.createSquareBySize(new DPoint_1.DPoint(this.stepSize));
|
|
56
|
+
this.size = this.maxPoint.clone().move(this.minPoint.clone().minus())
|
|
57
|
+
.divide(this.stepSize)
|
|
58
|
+
.ceil();
|
|
54
59
|
this.keys = Array.isArray(keys) ? keys : [keys];
|
|
55
60
|
this.generateCells();
|
|
56
61
|
}
|
|
@@ -83,9 +88,14 @@ var InterpolationMatrix = (function () {
|
|
|
83
88
|
}
|
|
84
89
|
return __assign({}, cell.properties);
|
|
85
90
|
};
|
|
86
|
-
Object.defineProperty(InterpolationMatrix.prototype, "
|
|
91
|
+
Object.defineProperty(InterpolationMatrix.prototype, "getCellData", {
|
|
87
92
|
get: function () {
|
|
88
|
-
return
|
|
93
|
+
return this.allCells.reduce(function (a, c) {
|
|
94
|
+
var _a = c.properties, x = _a.x, y = _a.y, props = __rest(_a, ["x", "y"]);
|
|
95
|
+
a[x] = a[x] || {};
|
|
96
|
+
a[x][y] = __assign({}, props);
|
|
97
|
+
return a;
|
|
98
|
+
}, {});
|
|
89
99
|
},
|
|
90
100
|
enumerable: false,
|
|
91
101
|
configurable: true
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import { DPolygon } from './DPolygon';
|
|
2
13
|
import { DPoint } from './DPoint';
|
|
3
14
|
import { isDefAndNotNull } from './utils';
|
|
@@ -11,6 +22,9 @@ export class InterpolationMatrix {
|
|
|
11
22
|
this.minPoint = bboxLike.leftTop;
|
|
12
23
|
this.maxPoint = bboxLike.rightBottom;
|
|
13
24
|
this.sizePoly = DPolygon.createSquareBySize(new DPoint(this.stepSize));
|
|
25
|
+
this.size = this.maxPoint.clone().move(this.minPoint.clone().minus())
|
|
26
|
+
.divide(this.stepSize)
|
|
27
|
+
.ceil();
|
|
14
28
|
this.keys = Array.isArray(keys) ? keys : [keys];
|
|
15
29
|
this.generateCells();
|
|
16
30
|
}
|
|
@@ -42,8 +56,13 @@ export class InterpolationMatrix {
|
|
|
42
56
|
}
|
|
43
57
|
return Object.assign({}, cell.properties);
|
|
44
58
|
}
|
|
45
|
-
get
|
|
46
|
-
return
|
|
59
|
+
get getCellData() {
|
|
60
|
+
return this.allCells.reduce((a, c) => {
|
|
61
|
+
const _a = c.properties, { x, y } = _a, props = __rest(_a, ["x", "y"]);
|
|
62
|
+
a[x] = a[x] || {};
|
|
63
|
+
a[x][y] = Object.assign({}, props);
|
|
64
|
+
return a;
|
|
65
|
+
}, {});
|
|
47
66
|
}
|
|
48
67
|
get allCellsClone() {
|
|
49
68
|
return this.allCells.map((p) => p.clone());
|
|
@@ -9,6 +9,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
12
23
|
var __read = (this && this.__read) || function (o, n) {
|
|
13
24
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
14
25
|
if (!m) return o;
|
|
@@ -25,15 +36,6 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
25
36
|
}
|
|
26
37
|
return ar;
|
|
27
38
|
};
|
|
28
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
29
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
30
|
-
if (ar || !(i in from)) {
|
|
31
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
32
|
-
ar[i] = from[i];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
36
|
-
};
|
|
37
39
|
import { DPolygon } from './DPolygon';
|
|
38
40
|
import { DPoint } from './DPoint';
|
|
39
41
|
import { isDefAndNotNull } from './utils';
|
|
@@ -48,6 +50,9 @@ var InterpolationMatrix = (function () {
|
|
|
48
50
|
this.minPoint = bboxLike.leftTop;
|
|
49
51
|
this.maxPoint = bboxLike.rightBottom;
|
|
50
52
|
this.sizePoly = DPolygon.createSquareBySize(new DPoint(this.stepSize));
|
|
53
|
+
this.size = this.maxPoint.clone().move(this.minPoint.clone().minus())
|
|
54
|
+
.divide(this.stepSize)
|
|
55
|
+
.ceil();
|
|
51
56
|
this.keys = Array.isArray(keys) ? keys : [keys];
|
|
52
57
|
this.generateCells();
|
|
53
58
|
}
|
|
@@ -80,9 +85,14 @@ var InterpolationMatrix = (function () {
|
|
|
80
85
|
}
|
|
81
86
|
return __assign({}, cell.properties);
|
|
82
87
|
};
|
|
83
|
-
Object.defineProperty(InterpolationMatrix.prototype, "
|
|
88
|
+
Object.defineProperty(InterpolationMatrix.prototype, "getCellData", {
|
|
84
89
|
get: function () {
|
|
85
|
-
return
|
|
90
|
+
return this.allCells.reduce(function (a, c) {
|
|
91
|
+
var _a = c.properties, x = _a.x, y = _a.y, props = __rest(_a, ["x", "y"]);
|
|
92
|
+
a[x] = a[x] || {};
|
|
93
|
+
a[x][y] = __assign({}, props);
|
|
94
|
+
return a;
|
|
95
|
+
}, {});
|
|
86
96
|
},
|
|
87
97
|
enumerable: false,
|
|
88
98
|
configurable: true
|