dgeoutils 2.2.6 → 2.2.10
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/DCircle.d.ts +0 -28
- package/dist/DCircle.js +0 -30
- package/dist/DLine.d.ts +0 -60
- package/dist/DLine.js +1 -67
- package/dist/DPoint.d.ts +2 -129
- package/dist/DPoint.js +6 -51
- package/dist/DPolygon.d.ts +1 -211
- package/dist/DPolygon.js +24 -252
- package/dist/DPolygonLoop.d.ts +2 -72
- package/dist/DPolygonLoop.js +35 -35
- package/dist/TraceMatrix.js +0 -1
- package/dist/utils.js +0 -3
- package/package.json +1 -1
package/dist/DPolygonLoop.js
CHANGED
|
@@ -8,34 +8,33 @@ var LoopFunctions;
|
|
|
8
8
|
LoopFunctions[LoopFunctions["height"] = 2] = "height";
|
|
9
9
|
LoopFunctions[LoopFunctions["setX"] = 3] = "setX";
|
|
10
10
|
LoopFunctions[LoopFunctions["setY"] = 4] = "setY";
|
|
11
|
-
LoopFunctions[LoopFunctions["
|
|
12
|
-
LoopFunctions[LoopFunctions["
|
|
13
|
-
LoopFunctions[LoopFunctions["
|
|
14
|
-
LoopFunctions[LoopFunctions["
|
|
15
|
-
LoopFunctions[LoopFunctions["
|
|
16
|
-
LoopFunctions[LoopFunctions["
|
|
17
|
-
LoopFunctions[LoopFunctions["
|
|
18
|
-
LoopFunctions[LoopFunctions["
|
|
19
|
-
LoopFunctions[LoopFunctions["
|
|
20
|
-
LoopFunctions[LoopFunctions["
|
|
21
|
-
LoopFunctions[LoopFunctions["
|
|
22
|
-
LoopFunctions[LoopFunctions["
|
|
23
|
-
LoopFunctions[LoopFunctions["
|
|
24
|
-
LoopFunctions[LoopFunctions["
|
|
25
|
-
LoopFunctions[LoopFunctions["
|
|
26
|
-
LoopFunctions[LoopFunctions["
|
|
27
|
-
LoopFunctions[LoopFunctions["
|
|
28
|
-
LoopFunctions[LoopFunctions["
|
|
29
|
-
LoopFunctions[LoopFunctions["
|
|
30
|
-
LoopFunctions[LoopFunctions["
|
|
31
|
-
LoopFunctions[LoopFunctions["
|
|
32
|
-
LoopFunctions[LoopFunctions["
|
|
33
|
-
LoopFunctions[LoopFunctions["
|
|
11
|
+
LoopFunctions[LoopFunctions["setZ"] = 5] = "setZ";
|
|
12
|
+
LoopFunctions[LoopFunctions["rotate"] = 6] = "rotate";
|
|
13
|
+
LoopFunctions[LoopFunctions["move"] = 7] = "move";
|
|
14
|
+
LoopFunctions[LoopFunctions["round"] = 8] = "round";
|
|
15
|
+
LoopFunctions[LoopFunctions["ceil"] = 9] = "ceil";
|
|
16
|
+
LoopFunctions[LoopFunctions["floor"] = 10] = "floor";
|
|
17
|
+
LoopFunctions[LoopFunctions["toFixed"] = 11] = "toFixed";
|
|
18
|
+
LoopFunctions[LoopFunctions["abs"] = 12] = "abs";
|
|
19
|
+
LoopFunctions[LoopFunctions["scale"] = 13] = "scale";
|
|
20
|
+
LoopFunctions[LoopFunctions["divide"] = 14] = "divide";
|
|
21
|
+
LoopFunctions[LoopFunctions["degreeToRadians"] = 15] = "degreeToRadians";
|
|
22
|
+
LoopFunctions[LoopFunctions["radiansToDegrees"] = 16] = "radiansToDegrees";
|
|
23
|
+
LoopFunctions[LoopFunctions["radiansToMeters"] = 17] = "radiansToMeters";
|
|
24
|
+
LoopFunctions[LoopFunctions["metersToRadians"] = 18] = "metersToRadians";
|
|
25
|
+
LoopFunctions[LoopFunctions["hipPoint"] = 19] = "hipPoint";
|
|
26
|
+
LoopFunctions[LoopFunctions["xPoint"] = 20] = "xPoint";
|
|
27
|
+
LoopFunctions[LoopFunctions["yPoint"] = 21] = "yPoint";
|
|
28
|
+
LoopFunctions[LoopFunctions["wPoint"] = 22] = "wPoint";
|
|
29
|
+
LoopFunctions[LoopFunctions["hPoint"] = 23] = "hPoint";
|
|
30
|
+
LoopFunctions[LoopFunctions["setIfLessThan"] = 24] = "setIfLessThan";
|
|
31
|
+
LoopFunctions[LoopFunctions["minus"] = 25] = "minus";
|
|
32
|
+
LoopFunctions[LoopFunctions["degreeToMeters"] = 26] = "degreeToMeters";
|
|
33
|
+
LoopFunctions[LoopFunctions["metersToDegree"] = 27] = "metersToDegree";
|
|
34
|
+
LoopFunctions[LoopFunctions["flipVertically"] = 28] = "flipVertically";
|
|
34
35
|
})(LoopFunctions || (LoopFunctions = {}));
|
|
35
|
-
// eslint-disable-next-line complexity
|
|
36
36
|
const decodePoolRecord = (a, { functionName, pointArg, numberPointArg, numberArg, setterArg }) => {
|
|
37
37
|
let res = a;
|
|
38
|
-
// eslint-disable-next-line default-case
|
|
39
38
|
switch (functionName) {
|
|
40
39
|
case LoopFunctions.getTileFromCoords:
|
|
41
40
|
res = (k) => a(k)
|
|
@@ -57,6 +56,10 @@ const decodePoolRecord = (a, { functionName, pointArg, numberPointArg, numberArg
|
|
|
57
56
|
res = (k) => a(k)
|
|
58
57
|
.setY(setterArg);
|
|
59
58
|
break;
|
|
59
|
+
case LoopFunctions.setZ:
|
|
60
|
+
res = (k) => a(k)
|
|
61
|
+
.setZ(setterArg);
|
|
62
|
+
break;
|
|
60
63
|
case LoopFunctions.rotate:
|
|
61
64
|
res = (k) => a(k)
|
|
62
65
|
.rotate(numberArg);
|
|
@@ -153,7 +156,6 @@ const decodePoolRecord = (a, { functionName, pointArg, numberPointArg, numberArg
|
|
|
153
156
|
return res;
|
|
154
157
|
};
|
|
155
158
|
class DPolygonLoop {
|
|
156
|
-
// eslint-disable-next-line no-empty-function,no-useless-constructor
|
|
157
159
|
constructor(parent) {
|
|
158
160
|
this.parent = parent;
|
|
159
161
|
this.pool = [];
|
|
@@ -161,15 +163,9 @@ class DPolygonLoop {
|
|
|
161
163
|
getLoopFunction() {
|
|
162
164
|
return this.pool.reduce(decodePoolRecord, (k) => k);
|
|
163
165
|
}
|
|
164
|
-
/**
|
|
165
|
-
* Run loop
|
|
166
|
-
*/
|
|
167
166
|
run() {
|
|
168
167
|
return this.parent.map(this.getLoopFunction());
|
|
169
168
|
}
|
|
170
|
-
/**
|
|
171
|
-
* @param zoom default value would be `z` of point
|
|
172
|
-
*/
|
|
173
169
|
getTileFromCoords(zoom) {
|
|
174
170
|
this.pool.push({
|
|
175
171
|
functionName: LoopFunctions.getTileFromCoords,
|
|
@@ -177,9 +173,6 @@ class DPolygonLoop {
|
|
|
177
173
|
});
|
|
178
174
|
return this;
|
|
179
175
|
}
|
|
180
|
-
/**
|
|
181
|
-
* @param zoom default value would be `z` of point
|
|
182
|
-
*/
|
|
183
176
|
getCoordsFromTile(zoom) {
|
|
184
177
|
this.pool.push({
|
|
185
178
|
functionName: LoopFunctions.getCoordsFromTile,
|
|
@@ -208,6 +201,13 @@ class DPolygonLoop {
|
|
|
208
201
|
});
|
|
209
202
|
return this;
|
|
210
203
|
}
|
|
204
|
+
setZ(z) {
|
|
205
|
+
this.pool.push({
|
|
206
|
+
functionName: LoopFunctions.setZ,
|
|
207
|
+
setterArg: z
|
|
208
|
+
});
|
|
209
|
+
return this;
|
|
210
|
+
}
|
|
211
211
|
rotate(a) {
|
|
212
212
|
this.pool.push({
|
|
213
213
|
functionName: LoopFunctions.rotate,
|
package/dist/TraceMatrix.js
CHANGED
|
@@ -96,7 +96,6 @@ class TraceMatrix {
|
|
|
96
96
|
let prevDirection = Infinity;
|
|
97
97
|
let p = group.at(0);
|
|
98
98
|
while (!p.equal(group.at(0)) || points.length < 2) {
|
|
99
|
-
// eslint-disable-next-line no-constant-condition
|
|
100
99
|
while (true) {
|
|
101
100
|
const nextValue = getByPosition(m, p.clone().move(traceDirections[direction]));
|
|
102
101
|
const nextNeighbourValue = getByPosition(m, p.clone().move(traceDirections[left(direction)]));
|
package/dist/utils.js
CHANGED
|
@@ -3,10 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createArray = exports.checkFunction = exports.warn = void 0;
|
|
4
4
|
const index_1 = require("./index");
|
|
5
5
|
const DPoint_1 = require("./DPoint");
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
6
|
const warn = (...args) => {
|
|
8
7
|
if (index_1.DGeo.DEBUG) {
|
|
9
|
-
// eslint-disable-next-line no-console
|
|
10
8
|
console.warn(...args);
|
|
11
9
|
}
|
|
12
10
|
};
|
|
@@ -45,7 +43,6 @@ const shouldBeMeters = (scope, funcName, argName) => (p) => {
|
|
|
45
43
|
return scope;
|
|
46
44
|
};
|
|
47
45
|
const checkFunction = (funcName) => ({
|
|
48
|
-
// eslint-disable-next-line func-names, object-shorthand
|
|
49
46
|
checkArgument: function (argName) {
|
|
50
47
|
if (!index_1.DGeo.DEBUG) {
|
|
51
48
|
return {
|