dgeoutils 2.4.1 → 2.4.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.
@@ -36,361 +36,366 @@ var LoopFunctions;
36
36
  LoopFunctions[LoopFunctions["metersToDegree"] = 30] = "metersToDegree";
37
37
  LoopFunctions[LoopFunctions["flipVertically"] = 31] = "flipVertically";
38
38
  })(LoopFunctions || (LoopFunctions = {}));
39
- const decodePoolRecord = (a, { functionName, pointArg, numberPointArg, numberArg, setterArg }) => {
40
- let res = a;
39
+ var decodePoolRecord = function (a, _a) {
40
+ var functionName = _a.functionName, pointArg = _a.pointArg, numberPointArg = _a.numberPointArg, numberArg = _a.numberArg, setterArg = _a.setterArg;
41
+ var res = a;
41
42
  switch (functionName) {
42
43
  case LoopFunctions.getTileFromCoords:
43
- res = (k) => a(k)
44
- .getTileFromCoords(numberArg);
44
+ res = function (k) { return a(k)
45
+ .getTileFromCoords(numberArg); };
45
46
  break;
46
47
  case LoopFunctions.getCoordsFromTile:
47
- res = (k) => a(k)
48
- .getCoordsFromTile(numberArg);
48
+ res = function (k) { return a(k)
49
+ .getCoordsFromTile(numberArg); };
49
50
  break;
50
51
  case LoopFunctions.height:
51
- res = (k) => a(k)
52
- .height(numberArg);
52
+ res = function (k) { return a(k)
53
+ .height(numberArg); };
53
54
  break;
54
55
  case LoopFunctions.setX:
55
- res = (k) => a(k)
56
- .setX(setterArg);
56
+ res = function (k) { return a(k)
57
+ .setX(setterArg); };
57
58
  break;
58
59
  case LoopFunctions.setY:
59
- res = (k) => a(k)
60
- .setY(setterArg);
60
+ res = function (k) { return a(k)
61
+ .setY(setterArg); };
61
62
  break;
62
63
  case LoopFunctions.setZ:
63
- res = (k) => a(k)
64
- .setZ(setterArg);
64
+ res = function (k) { return a(k)
65
+ .setZ(setterArg); };
65
66
  break;
66
67
  case LoopFunctions.rotate:
67
- res = (k) => a(k)
68
- .rotate(numberArg);
68
+ res = function (k) { return a(k)
69
+ .rotate(numberArg); };
69
70
  break;
70
71
  case LoopFunctions.rotate3dX:
71
- res = (k) => a(k)
72
- .rotate3dX(numberArg);
72
+ res = function (k) { return a(k)
73
+ .rotate3dX(numberArg); };
73
74
  break;
74
75
  case LoopFunctions.rotate3dY:
75
- res = (k) => a(k)
76
- .rotate3dY(numberArg);
76
+ res = function (k) { return a(k)
77
+ .rotate3dY(numberArg); };
77
78
  break;
78
79
  case LoopFunctions.rotate3dZ:
79
- res = (k) => a(k)
80
- .rotate3dZ(numberArg);
80
+ res = function (k) { return a(k)
81
+ .rotate3dZ(numberArg); };
81
82
  break;
82
83
  case LoopFunctions.move:
83
- res = (k) => a(k)
84
- .move(numberPointArg, numberArg);
84
+ res = function (k) { return a(k)
85
+ .move(numberPointArg, numberArg); };
85
86
  break;
86
87
  case LoopFunctions.round:
87
- res = (k) => a(k)
88
- .round();
88
+ res = function (k) { return a(k)
89
+ .round(); };
89
90
  break;
90
91
  case LoopFunctions.ceil:
91
- res = (k) => a(k)
92
- .ceil();
92
+ res = function (k) { return a(k)
93
+ .ceil(); };
93
94
  break;
94
95
  case LoopFunctions.floor:
95
- res = (k) => a(k)
96
- .floor();
96
+ res = function (k) { return a(k)
97
+ .floor(); };
97
98
  break;
98
99
  case LoopFunctions.toFixed:
99
- res = (k) => a(k)
100
- .toFixed(numberArg);
100
+ res = function (k) { return a(k)
101
+ .toFixed(numberArg); };
101
102
  break;
102
103
  case LoopFunctions.abs:
103
- res = (k) => a(k)
104
- .abs();
104
+ res = function (k) { return a(k)
105
+ .abs(); };
105
106
  break;
106
107
  case LoopFunctions.scale:
107
- res = (k) => a(k)
108
- .scale(numberPointArg, numberArg);
108
+ res = function (k) { return a(k)
109
+ .scale(numberPointArg, numberArg); };
109
110
  break;
110
111
  case LoopFunctions.divide:
111
- res = (k) => a(k)
112
- .divide(numberPointArg, numberArg);
112
+ res = function (k) { return a(k)
113
+ .divide(numberPointArg, numberArg); };
113
114
  break;
114
115
  case LoopFunctions.degreeToRadians:
115
- res = (k) => a(k)
116
- .degreeToRadians();
116
+ res = function (k) { return a(k)
117
+ .degreeToRadians(); };
117
118
  break;
118
119
  case LoopFunctions.radiansToDegrees:
119
- res = (k) => a(k)
120
- .radiansToDegrees();
120
+ res = function (k) { return a(k)
121
+ .radiansToDegrees(); };
121
122
  break;
122
123
  case LoopFunctions.radiansToMeters:
123
- res = (k) => a(k)
124
- .radiansToMeters();
124
+ res = function (k) { return a(k)
125
+ .radiansToMeters(); };
125
126
  break;
126
127
  case LoopFunctions.metersToRadians:
127
- res = (k) => a(k)
128
- .metersToRadians();
128
+ res = function (k) { return a(k)
129
+ .metersToRadians(); };
129
130
  break;
130
131
  case LoopFunctions.hipPoint:
131
- res = (k) => a(k)
132
- .hipPoint;
132
+ res = function (k) { return a(k)
133
+ .hipPoint; };
133
134
  break;
134
135
  case LoopFunctions.xPoint:
135
- res = (k) => a(k)
136
- .xPoint;
136
+ res = function (k) { return a(k)
137
+ .xPoint; };
137
138
  break;
138
139
  case LoopFunctions.yPoint:
139
- res = (k) => a(k)
140
- .yPoint;
140
+ res = function (k) { return a(k)
141
+ .yPoint; };
141
142
  break;
142
143
  case LoopFunctions.wPoint:
143
- res = (k) => a(k)
144
- .wPoint;
144
+ res = function (k) { return a(k)
145
+ .wPoint; };
145
146
  break;
146
147
  case LoopFunctions.hPoint:
147
- res = (k) => a(k)
148
- .hPoint;
148
+ res = function (k) { return a(k)
149
+ .hPoint; };
149
150
  break;
150
151
  case LoopFunctions.setIfLessThan:
151
- res = (k) => a(k)
152
- .setIfLessThan(pointArg);
152
+ res = function (k) { return a(k)
153
+ .setIfLessThan(pointArg); };
153
154
  break;
154
155
  case LoopFunctions.minus:
155
- res = (k) => a(k)
156
- .minus();
156
+ res = function (k) { return a(k)
157
+ .minus(); };
157
158
  break;
158
159
  case LoopFunctions.degreeToMeters:
159
- res = (k) => a(k)
160
- .degreeToMeters();
160
+ res = function (k) { return a(k)
161
+ .degreeToMeters(); };
161
162
  break;
162
163
  case LoopFunctions.metersToDegree:
163
- res = (k) => a(k)
164
- .metersToDegree();
164
+ res = function (k) { return a(k)
165
+ .metersToDegree(); };
165
166
  break;
166
167
  case LoopFunctions.flipVertically:
167
- res = (k) => a(k)
168
- .flipVertically(numberPointArg);
168
+ res = function (k) { return a(k)
169
+ .flipVertically(numberPointArg); };
169
170
  break;
170
171
  }
171
172
  return res;
172
173
  };
173
- class DPolygonLoop {
174
- constructor(parent) {
174
+ var DPolygonLoop = (function () {
175
+ function DPolygonLoop(parent) {
175
176
  this.parent = parent;
176
177
  this.pool = [];
177
178
  }
178
- getLoopFunction() {
179
- return this.pool.reduce(decodePoolRecord, (k) => k);
180
- }
181
- run() {
179
+ DPolygonLoop.prototype.getLoopFunction = function () {
180
+ return this.pool.reduce(decodePoolRecord, function (k) { return k; });
181
+ };
182
+ DPolygonLoop.prototype.run = function () {
182
183
  return this.parent.map(this.getLoopFunction());
183
- }
184
- getTileFromCoords(zoom) {
184
+ };
185
+ DPolygonLoop.prototype.getTileFromCoords = function (zoom) {
185
186
  this.pool.push({
186
187
  functionName: LoopFunctions.getTileFromCoords,
187
188
  numberArg: zoom
188
189
  });
189
190
  return this;
190
- }
191
- getCoordsFromTile(zoom) {
191
+ };
192
+ DPolygonLoop.prototype.getCoordsFromTile = function (zoom) {
192
193
  this.pool.push({
193
194
  functionName: LoopFunctions.getCoordsFromTile,
194
195
  numberArg: zoom
195
196
  });
196
197
  return this;
197
- }
198
- height(z) {
198
+ };
199
+ DPolygonLoop.prototype.height = function (z) {
199
200
  this.pool.push({
200
201
  functionName: LoopFunctions.height,
201
202
  numberArg: z
202
203
  });
203
204
  return this;
204
- }
205
- setX(x) {
205
+ };
206
+ DPolygonLoop.prototype.setX = function (x) {
206
207
  this.pool.push({
207
208
  functionName: LoopFunctions.setX,
208
209
  setterArg: x
209
210
  });
210
211
  return this;
211
- }
212
- setY(y) {
212
+ };
213
+ DPolygonLoop.prototype.setY = function (y) {
213
214
  this.pool.push({
214
215
  functionName: LoopFunctions.setY,
215
216
  setterArg: y
216
217
  });
217
218
  return this;
218
- }
219
- setZ(z) {
219
+ };
220
+ DPolygonLoop.prototype.setZ = function (z) {
220
221
  this.pool.push({
221
222
  functionName: LoopFunctions.setZ,
222
223
  setterArg: z
223
224
  });
224
225
  return this;
225
- }
226
- rotate(a) {
226
+ };
227
+ DPolygonLoop.prototype.rotate = function (a) {
227
228
  this.pool.push({
228
229
  functionName: LoopFunctions.rotate,
229
230
  numberArg: a
230
231
  });
231
232
  return this;
232
- }
233
- rotate3dX(a) {
233
+ };
234
+ DPolygonLoop.prototype.rotate3dX = function (a) {
234
235
  this.pool.push({
235
236
  functionName: LoopFunctions.rotate3dX,
236
237
  numberArg: a
237
238
  });
238
239
  return this;
239
- }
240
- rotate3dY(a) {
240
+ };
241
+ DPolygonLoop.prototype.rotate3dY = function (a) {
241
242
  this.pool.push({
242
243
  functionName: LoopFunctions.rotate3dY,
243
244
  numberArg: a
244
245
  });
245
246
  return this;
246
- }
247
- rotate3dZ(a) {
247
+ };
248
+ DPolygonLoop.prototype.rotate3dZ = function (a) {
248
249
  this.pool.push({
249
250
  functionName: LoopFunctions.rotate3dZ,
250
251
  numberArg: a
251
252
  });
252
253
  return this;
253
- }
254
- move(x, y = x) {
254
+ };
255
+ DPolygonLoop.prototype.move = function (x, y) {
256
+ if (y === void 0) { y = x; }
255
257
  this.pool.push({
256
258
  functionName: LoopFunctions.move,
257
259
  numberPointArg: x,
258
260
  numberArg: y
259
261
  });
260
262
  return this;
261
- }
262
- round() {
263
+ };
264
+ DPolygonLoop.prototype.round = function () {
263
265
  this.pool.push({
264
266
  functionName: LoopFunctions.round
265
267
  });
266
268
  return this;
267
- }
268
- ceil() {
269
+ };
270
+ DPolygonLoop.prototype.ceil = function () {
269
271
  this.pool.push({
270
272
  functionName: LoopFunctions.ceil
271
273
  });
272
274
  return this;
273
- }
274
- floor() {
275
+ };
276
+ DPolygonLoop.prototype.floor = function () {
275
277
  this.pool.push({
276
278
  functionName: LoopFunctions.floor
277
279
  });
278
280
  return this;
279
- }
280
- toFixed(n = 2) {
281
+ };
282
+ DPolygonLoop.prototype.toFixed = function (n) {
283
+ if (n === void 0) { n = 2; }
281
284
  this.pool.push({
282
285
  functionName: LoopFunctions.toFixed,
283
286
  numberArg: n
284
287
  });
285
288
  return this;
286
- }
287
- abs() {
289
+ };
290
+ DPolygonLoop.prototype.abs = function () {
288
291
  this.pool.push({
289
292
  functionName: LoopFunctions.abs
290
293
  });
291
294
  return this;
292
- }
293
- scale(x, y = x) {
295
+ };
296
+ DPolygonLoop.prototype.scale = function (x, y) {
297
+ if (y === void 0) { y = x; }
294
298
  this.pool.push({
295
299
  functionName: LoopFunctions.scale,
296
300
  numberPointArg: x,
297
301
  numberArg: y
298
302
  });
299
303
  return this;
300
- }
301
- divide(x, y) {
304
+ };
305
+ DPolygonLoop.prototype.divide = function (x, y) {
302
306
  this.pool.push({
303
307
  functionName: LoopFunctions.divide,
304
308
  numberPointArg: x,
305
309
  numberArg: y
306
310
  });
307
311
  return this;
308
- }
309
- degreeToRadians() {
312
+ };
313
+ DPolygonLoop.prototype.degreeToRadians = function () {
310
314
  this.pool.push({
311
315
  functionName: LoopFunctions.degreeToRadians
312
316
  });
313
317
  return this;
314
- }
315
- radiansToDegrees() {
318
+ };
319
+ DPolygonLoop.prototype.radiansToDegrees = function () {
316
320
  this.pool.push({
317
321
  functionName: LoopFunctions.radiansToDegrees
318
322
  });
319
323
  return this;
320
- }
321
- radiansToMeters() {
324
+ };
325
+ DPolygonLoop.prototype.radiansToMeters = function () {
322
326
  this.pool.push({
323
327
  functionName: LoopFunctions.radiansToMeters
324
328
  });
325
329
  return this;
326
- }
327
- metersToRadians() {
330
+ };
331
+ DPolygonLoop.prototype.metersToRadians = function () {
328
332
  this.pool.push({
329
333
  functionName: LoopFunctions.metersToRadians
330
334
  });
331
335
  return this;
332
- }
333
- getHipPoint() {
336
+ };
337
+ DPolygonLoop.prototype.getHipPoint = function () {
334
338
  this.pool.push({
335
339
  functionName: LoopFunctions.hipPoint
336
340
  });
337
341
  return this;
338
- }
339
- getXPoint() {
342
+ };
343
+ DPolygonLoop.prototype.getXPoint = function () {
340
344
  this.pool.push({
341
345
  functionName: LoopFunctions.xPoint
342
346
  });
343
347
  return this;
344
- }
345
- getYPoint() {
348
+ };
349
+ DPolygonLoop.prototype.getYPoint = function () {
346
350
  this.pool.push({
347
351
  functionName: LoopFunctions.yPoint
348
352
  });
349
353
  return this;
350
- }
351
- getWPoint() {
354
+ };
355
+ DPolygonLoop.prototype.getWPoint = function () {
352
356
  this.pool.push({
353
357
  functionName: LoopFunctions.wPoint
354
358
  });
355
359
  return this;
356
- }
357
- getHPoint() {
360
+ };
361
+ DPolygonLoop.prototype.getHPoint = function () {
358
362
  this.pool.push({
359
363
  functionName: LoopFunctions.hPoint
360
364
  });
361
365
  return this;
362
- }
363
- setIfLessThan(p) {
366
+ };
367
+ DPolygonLoop.prototype.setIfLessThan = function (p) {
364
368
  this.pool.push({
365
369
  functionName: LoopFunctions.setIfLessThan,
366
370
  pointArg: p
367
371
  });
368
372
  return this;
369
- }
370
- minus() {
373
+ };
374
+ DPolygonLoop.prototype.minus = function () {
371
375
  this.pool.push({
372
376
  functionName: LoopFunctions.minus
373
377
  });
374
378
  return this;
375
- }
376
- degreeToMeters() {
379
+ };
380
+ DPolygonLoop.prototype.degreeToMeters = function () {
377
381
  this.pool.push({
378
382
  functionName: LoopFunctions.degreeToMeters
379
383
  });
380
384
  return this;
381
- }
382
- metersToDegree() {
385
+ };
386
+ DPolygonLoop.prototype.metersToDegree = function () {
383
387
  this.pool.push({
384
388
  functionName: LoopFunctions.metersToDegree
385
389
  });
386
390
  return this;
387
- }
388
- flipVertically(size) {
391
+ };
392
+ DPolygonLoop.prototype.flipVertically = function (size) {
389
393
  this.pool.push({
390
394
  functionName: LoopFunctions.flipVertically,
391
395
  numberPointArg: size
392
396
  });
393
397
  return this;
394
- }
395
- }
398
+ };
399
+ return DPolygonLoop;
400
+ }());
396
401
  exports.DPolygonLoop = DPolygonLoop;
@@ -1,22 +1,45 @@
1
1
  "use strict";
2
+ var __values = (this && this.__values) || function(o) {
3
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4
+ if (m) return m.call(o);
5
+ if (o && typeof o.length === "number") return {
6
+ next: function () {
7
+ if (o && i >= o.length) o = void 0;
8
+ return { value: o && o[i++], done: !o };
9
+ }
10
+ };
11
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
12
+ };
2
13
  Object.defineProperty(exports, "__esModule", { value: true });
3
14
  exports.FastSearch = void 0;
4
- class FastSearch {
5
- constructor() {
15
+ var FastSearch = (function () {
16
+ function FastSearch() {
6
17
  this.searchStore = {};
7
18
  }
8
- add(points) {
9
- for (const { x, y, z } of points) {
10
- if (!this.searchStore[x]) {
11
- this.searchStore[x] = {};
19
+ FastSearch.prototype.add = function (points) {
20
+ var e_1, _a;
21
+ try {
22
+ for (var points_1 = __values(points), points_1_1 = points_1.next(); !points_1_1.done; points_1_1 = points_1.next()) {
23
+ var _b = points_1_1.value, x = _b.x, y = _b.y, z = _b.z;
24
+ if (!this.searchStore[x]) {
25
+ this.searchStore[x] = {};
26
+ }
27
+ if (!this.searchStore[x][y]) {
28
+ this.searchStore[x][y] = {};
29
+ }
30
+ this.searchStore[x][y][z || 'undefined'] = true;
12
31
  }
13
- if (!this.searchStore[x][y]) {
14
- this.searchStore[x][y] = {};
32
+ }
33
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
34
+ finally {
35
+ try {
36
+ if (points_1_1 && !points_1_1.done && (_a = points_1.return)) _a.call(points_1);
15
37
  }
16
- this.searchStore[x][y][z || 'undefined'] = true;
38
+ finally { if (e_1) throw e_1.error; }
17
39
  }
18
- }
19
- find({ x, y, z }) {
40
+ };
41
+ FastSearch.prototype.find = function (_a) {
42
+ var x = _a.x, y = _a.y, z = _a.z;
20
43
  if (!this.searchStore[x]) {
21
44
  return false;
22
45
  }
@@ -24,6 +47,7 @@ class FastSearch {
24
47
  return false;
25
48
  }
26
49
  return this.searchStore[x][y][z || 'undefined'];
27
- }
28
- }
50
+ };
51
+ return FastSearch;
52
+ }());
29
53
  exports.FastSearch = FastSearch;