nodes2ts 3.0.0 → 4.0.1

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.
Files changed (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +102 -15
  3. package/dist/export.cjs +5350 -0
  4. package/dist/export.cjs.map +1 -0
  5. package/dist/export.d.cts +1847 -0
  6. package/dist/export.d.ts +1837 -20
  7. package/dist/export.js +5299 -62
  8. package/dist/export.js.map +1 -1
  9. package/package.json +34 -55
  10. package/.eslintignore +0 -3
  11. package/.eslintrc.cjs +0 -11
  12. package/.github/workflows/lint.js.yml +0 -22
  13. package/.github/workflows/node.js.yml +0 -22
  14. package/.mocharc.js +0 -7
  15. package/dist/Interval.d.ts +0 -24
  16. package/dist/Interval.js +0 -23
  17. package/dist/Interval.js.map +0 -1
  18. package/dist/MutableInteger.d.ts +0 -4
  19. package/dist/MutableInteger.js +0 -10
  20. package/dist/MutableInteger.js.map +0 -1
  21. package/dist/Platform.d.ts +0 -15
  22. package/dist/Platform.js +0 -53
  23. package/dist/Platform.js.map +0 -1
  24. package/dist/R1Interval.d.ts +0 -76
  25. package/dist/R1Interval.js +0 -158
  26. package/dist/R1Interval.js.map +0 -1
  27. package/dist/R2Vector.d.ts +0 -34
  28. package/dist/R2Vector.js +0 -131
  29. package/dist/R2Vector.js.map +0 -1
  30. package/dist/S1Angle.d.ts +0 -60
  31. package/dist/S1Angle.js +0 -133
  32. package/dist/S1Angle.js.map +0 -1
  33. package/dist/S1ChordAngle.d.ts +0 -166
  34. package/dist/S1ChordAngle.js +0 -318
  35. package/dist/S1ChordAngle.js.map +0 -1
  36. package/dist/S1Interval.d.ts +0 -109
  37. package/dist/S1Interval.js +0 -398
  38. package/dist/S1Interval.js.map +0 -1
  39. package/dist/S2.d.ts +0 -96
  40. package/dist/S2.js +0 -231
  41. package/dist/S2.js.map +0 -1
  42. package/dist/S2Cap.d.ts +0 -122
  43. package/dist/S2Cap.js +0 -399
  44. package/dist/S2Cap.js.map +0 -1
  45. package/dist/S2Cell.d.ts +0 -106
  46. package/dist/S2Cell.js +0 -358
  47. package/dist/S2Cell.js.map +0 -1
  48. package/dist/S2CellId.d.ts +0 -290
  49. package/dist/S2CellId.js +0 -983
  50. package/dist/S2CellId.js.map +0 -1
  51. package/dist/S2CellUnion.d.ts +0 -179
  52. package/dist/S2CellUnion.js +0 -523
  53. package/dist/S2CellUnion.js.map +0 -1
  54. package/dist/S2EdgeUtil.d.ts +0 -17
  55. package/dist/S2EdgeUtil.js +0 -785
  56. package/dist/S2EdgeUtil.js.map +0 -1
  57. package/dist/S2LatLng.d.ts +0 -77
  58. package/dist/S2LatLng.js +0 -186
  59. package/dist/S2LatLng.js.map +0 -1
  60. package/dist/S2LatLngRect.d.ts +0 -190
  61. package/dist/S2LatLngRect.js +0 -624
  62. package/dist/S2LatLngRect.js.map +0 -1
  63. package/dist/S2Metric.d.ts +0 -38
  64. package/dist/S2Metric.js +0 -79
  65. package/dist/S2Metric.js.map +0 -1
  66. package/dist/S2Point.d.ts +0 -78
  67. package/dist/S2Point.js +0 -250
  68. package/dist/S2Point.js.map +0 -1
  69. package/dist/S2Projections.d.ts +0 -102
  70. package/dist/S2Projections.js +0 -331
  71. package/dist/S2Projections.js.map +0 -1
  72. package/dist/S2Region.d.ts +0 -31
  73. package/dist/S2Region.js +0 -18
  74. package/dist/S2Region.js.map +0 -1
  75. package/dist/S2RegionCoverer.d.ts +0 -186
  76. package/dist/S2RegionCoverer.js +0 -471
  77. package/dist/S2RegionCoverer.js.map +0 -1
  78. package/dist/utils/preconditions.d.ts +0 -2
  79. package/dist/utils/preconditions.js +0 -16
  80. package/dist/utils/preconditions.js.map +0 -1
package/dist/S2Cell.js DELETED
@@ -1,358 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.S2Cell = void 0;
4
- const Long = require("long");
5
- const S2CellId_1 = require("./S2CellId");
6
- const S2Point_1 = require("./S2Point");
7
- const S2LatLng_1 = require("./S2LatLng");
8
- const S2Projections_1 = require("./S2Projections");
9
- const S2_1 = require("./S2");
10
- const S2LatLngRect_1 = require("./S2LatLngRect");
11
- const R1Interval_1 = require("./R1Interval");
12
- const S1Interval_1 = require("./S1Interval");
13
- const S2Cap_1 = require("./S2Cap");
14
- class S2Cell {
15
- constructor(cellID) {
16
- this.cellID = cellID;
17
- if (cellID != null) {
18
- this.init(cellID);
19
- }
20
- }
21
- get id() {
22
- return this.cellID;
23
- }
24
- static fromFace(face) {
25
- return new S2Cell(S2CellId_1.S2CellId.fromFace(face));
26
- }
27
- // This is a static method in order to provide named parameters.
28
- static fromFacePosLevel(face, pos, level) {
29
- return new S2Cell(S2CellId_1.S2CellId.fromFacePosLevel(face, new Long(pos), level));
30
- }
31
- // Convenience methods.
32
- static fromPoint(p) {
33
- return new S2Cell(S2CellId_1.S2CellId.fromPoint(p));
34
- }
35
- static fromLatLng(ll) {
36
- return new S2Cell(S2CellId_1.S2CellId.fromPoint(ll.toPoint()));
37
- }
38
- isLeaf() {
39
- return this._level == S2CellId_1.S2CellId.MAX_LEVEL;
40
- }
41
- getVertex(k) {
42
- return S2Point_1.S2Point.normalize(this.getVertexRaw(k));
43
- }
44
- /**
45
- * Return the k-th vertex of the cell (k = 0,1,2,3). Vertices are returned in
46
- * CCW order. The points returned by GetVertexRaw are not necessarily unit
47
- * length.
48
- */
49
- getVertexRaw(k) {
50
- // Vertices are returned in the order SW, SE, NE, NW.
51
- return S2Projections_1.S2Projections.faceUvToXyz(this._face, ((k >> 1) ^ (k & 1)) == 0 ? this.uMin : this.uMax, (k >> 1) == 0 ? this.vMin : this.vMax);
52
- }
53
- getEdge(k) {
54
- return S2Point_1.S2Point.normalize(this.getEdgeRaw(k));
55
- }
56
- getEdgeRaw(k) {
57
- switch (k) {
58
- case 0:
59
- return S2Projections_1.S2Projections.getVNorm(this._face, this.vMin); // South
60
- case 1:
61
- return S2Projections_1.S2Projections.getUNorm(this._face, this.uMax); // East
62
- case 2:
63
- return S2Point_1.S2Point.neg(S2Projections_1.S2Projections.getVNorm(this._face, this.vMax)); // North
64
- default:
65
- return S2Point_1.S2Point.neg(S2Projections_1.S2Projections.getUNorm(this._face, this.uMin)); // West
66
- }
67
- }
68
- /**
69
- * Return the inward-facing normal of the great circle passing through the
70
- * edge from vertex k to vertex k+1 (mod 4). The normals returned by
71
- * GetEdgeRaw are not necessarily unit length.
72
- *
73
- * If this is not a leaf cell, set children[0..3] to the four children of
74
- * this cell (in traversal order) and return true. Otherwise returns false.
75
- * This method is equivalent to the following:
76
- *
77
- * for (pos=0, id=child_begin(); id != child_end(); id = id.next(), ++pos)
78
- * children[i] = S2Cell(id);
79
- *
80
- * except that it is more than two times faster.
81
- */
82
- subdivide() {
83
- // This function is equivalent to just iterating over the child cell ids
84
- // and calling the S2Cell constructor, but it is about 2.5 times faster.
85
- if (this.id.isLeaf()) {
86
- return null;
87
- }
88
- const children = new Array(4);
89
- for (let i = 0; i < 4; ++i) {
90
- children[i] = new S2Cell();
91
- }
92
- // Create four children with the appropriate bounds.
93
- let id = this.id.childBegin();
94
- const mid = this.getCenterUV();
95
- const uMid = mid.x;
96
- const vMid = mid.y;
97
- for (let pos = 0; pos < 4; ++pos, id = id.next()) {
98
- const child = children[pos];
99
- child._face = this.face;
100
- child._level = this.level + 1;
101
- child._orientation = this.orientation ^ S2_1.S2.POS_TO_ORIENTATION[pos];
102
- child.cellID = id;
103
- // We want to split the cell in half in "u" and "v". To decide which
104
- // side to set equal to the midpoint value, we look at cell's (i,j)
105
- // position within its parent. The index for "i" is in bit 1 of ij.
106
- const ij = S2_1.S2.POS_TO_IJ[this.orientation][pos];
107
- // The dimension 0 index (i/u) is in bit 1 of ij.
108
- if ((ij & 0x2) != 0) {
109
- child.uMin = uMid;
110
- child.uMax = this.uMax;
111
- }
112
- else {
113
- child.uMin = this.uMin;
114
- child.uMax = uMid;
115
- }
116
- // The dimension 1 index (j/v) is in bit 0 of ij.
117
- if ((ij & 0x1) != 0) {
118
- child.vMin = vMid;
119
- child.vMax = this.vMax;
120
- }
121
- else {
122
- child.vMin = this.vMin;
123
- child.vMax = vMid;
124
- }
125
- }
126
- return children;
127
- }
128
- /**
129
- * Return the direction vector corresponding to the center in (s,t)-space of
130
- * the given cell. This is the point at which the cell is divided into four
131
- * subcells; it is not necessarily the centroid of the cell in (u,v)-space or
132
- * (x,y,z)-space. The point returned by GetCenterRaw is not necessarily unit
133
- * length.
134
- */
135
- getCenter() {
136
- return S2Point_1.S2Point.normalize(this.getCenterRaw());
137
- }
138
- getCenterRaw() {
139
- return this.cellID.toPointRaw();
140
- }
141
- /**
142
- * Return the center of the cell in (u,v) coordinates (see {@code
143
- * S2Projections}). Note that the center of the cell is defined as the point
144
- * at which it is recursively subdivided into four children; in general, it is
145
- * not at the midpoint of the (u,v) rectangle covered by the cell
146
- */
147
- getCenterUV() {
148
- return this.cellID.getCenterUV();
149
- }
150
- /**
151
- * Return the average area of cells at this level. This is accurate to within
152
- * a factor of 1.7 (for S2_QUADRATIC_PROJECTION) and is extremely cheap to
153
- * compute.
154
- */
155
- static averageArea(level) {
156
- return S2Projections_1.S2Projections.AVG_AREA.getValue(level);
157
- }
158
- /**
159
- * Return the average area of cells at this level. This is accurate to within
160
- * a factor of 1.7 (for S2_QUADRATIC_PROJECTION) and is extremely cheap to
161
- * compute.
162
- */
163
- averageArea() {
164
- return S2Projections_1.S2Projections.AVG_AREA.getValue(this._level);
165
- }
166
- /**
167
- * Return the approximate area of this cell. This method is accurate to within
168
- * 3% percent for all cell sizes and accurate to within 0.1% for cells at
169
- * level 5 or higher (i.e. 300km square or smaller). It is moderately cheap to
170
- * compute.
171
- */
172
- approxArea() {
173
- // All cells at the first two levels have the same area.
174
- if (this._level < 2) {
175
- return this.averageArea();
176
- }
177
- // First, compute the approximate area of the cell when projected
178
- // perpendicular to its normal. The cross product of its diagonals gives
179
- // the normal, and the length of the normal is twice the projected area.
180
- const flatArea = S2Point_1.S2Point.crossProd(S2Point_1.S2Point.sub(this.getVertex(2), this.getVertex(0)), S2Point_1.S2Point.sub(this.getVertex(3), this.getVertex(1))).norm() * 0.5;
181
- // double flatArea = 0.5 * S2Point.crossProd(
182
- // S2Point.sub(getVertex(2), getVertex(0)), S2Point.sub(getVertex(3), getVertex(1))).norm();
183
- // Now, compensate for the curvature of the cell surface by pretending
184
- // that the cell is shaped like a spherical cap. The ratio of the
185
- // area of a spherical cap to the area of its projected disc turns out
186
- // to be 2 / (1 + sqrt(1 - r*r)) where "r" is the radius of the disc.
187
- // For example, when r=0 the ratio is 1, and when r=1 the ratio is 2.
188
- // Here we set Pi*r*r == flat_area to find the equivalent disc.
189
- return flatArea * 2 / (Math.sqrt((Math.min(flatArea * S2_1.S2.M_1_PI, 1) * -1) + 1) + 1);
190
- }
191
- //
192
- // /**
193
- // * Return the area of this cell as accurately as possible. This method is more
194
- // * expensive but it is accurate to 6 digits of precision even for leaf cells
195
- // * (whose area is approximately 1e-18).
196
- // */
197
- exactArea() {
198
- const v0 = this.getVertex(0);
199
- const v1 = this.getVertex(1);
200
- const v2 = this.getVertex(2);
201
- const v3 = this.getVertex(3);
202
- return S2_1.S2.area(v0, v1, v2) + (S2_1.S2.area(v0, v2, v3));
203
- }
204
- // //////////////////////////////////////////////////////////////////////
205
- // S2Region interface (see {@code S2Region} for details):
206
- getCapBound() {
207
- // Use the cell center in (u,v)-space as the cap axis. This vector is
208
- // very close to GetCenter() and faster to compute. Neither one of these
209
- // vectors yields the bounding cap with minimal surface area, but they
210
- // are both pretty close.
211
- //
212
- // It's possible to show that the two vertices that are furthest from
213
- // the (u,v)-origin never determine the maximum cap size (this is a
214
- // possible future optimization).
215
- const uv = this.getCenterUV();
216
- const center = S2Point_1.S2Point.normalize(S2Projections_1.S2Projections.faceUvToXyz(this._face, uv.x, uv.y));
217
- let cap = S2Cap_1.S2Cap.fromAxisHeight(center, 0);
218
- for (let k = 0; k < 4; ++k) {
219
- cap = cap.addPoint(this.getVertex(k));
220
- }
221
- return cap;
222
- }
223
- // 35.26 degrees
224
- getPoint(i, j) {
225
- return S2Projections_1.S2Projections.faceUvToXyz(this._face, i == 0 ? this.uMin : this.uMax, j == 0 ? this.vMin : this.vMax);
226
- }
227
- getRectBound() {
228
- if (this._level > 0) {
229
- // Except for cells at level 0, the latitude and longitude extremes are
230
- // attained at the vertices. Furthermore, the latitude range is
231
- // determined by one pair of diagonally opposite vertices and the
232
- // longitude range is determined by the other pair.
233
- //
234
- // We first determine which corner (i,j) of the cell has the largest
235
- // absolute latitude. To maximize latitude, we want to find the point in
236
- // the cell that has the largest absolute z-coordinate and the smallest
237
- // absolute x- and y-coordinates. To do this we look at each coordinate
238
- // (u and v), and determine whether we want to minimize or maximize that
239
- // coordinate based on the axis direction and the cell's (u,v) quadrant.
240
- const u = this.uMin + this.uMax;
241
- const v = this.vMin + this.vMax;
242
- const i = S2Projections_1.S2Projections.getUAxis(this._face).z == 0 ? (u < 0 ? 1 : 0) : (u > 0 ? 1 : 0);
243
- const j = S2Projections_1.S2Projections.getVAxis(this._face).z == 0 ? (v < 0 ? 1 : 0) : (v > 0 ? 1 : 0);
244
- const lat = R1Interval_1.R1Interval.fromPointPair(S2LatLng_1.S2LatLng.latitude(this.getPoint(i, j)).radians, S2LatLng_1.S2LatLng.latitude(this.getPoint(1 - i, 1 - j)).radians);
245
- const lng = S1Interval_1.S1Interval.fromPointPair(S2LatLng_1.S2LatLng.longitude(this.getPoint(i, 1 - j)).radians, S2LatLng_1.S2LatLng.longitude(this.getPoint(1 - i, j)).radians);
246
- // DBL_EPSILON
247
- return new S2LatLngRect_1.S2LatLngRect(lat, lng)
248
- .expanded(S2LatLng_1.S2LatLng.fromRadians(S2_1.S2.DBL_EPSILON, S2_1.S2.DBL_EPSILON))
249
- .polarClosure();
250
- }
251
- // The face centers are the +X, +Y, +Z, -X, -Y, -Z axes in that order.
252
- // assert (S2Projections.getNorm(face).get(face % 3) == ((face < 3) ? 1 : -1));
253
- switch (this._face) {
254
- case 0:
255
- return new S2LatLngRect_1.S2LatLngRect(new R1Interval_1.R1Interval(-S2_1.S2.M_PI_4, S2_1.S2.M_PI_4), new S1Interval_1.S1Interval(-S2_1.S2.M_PI_4, S2_1.S2.M_PI_4));
256
- case 1:
257
- return new S2LatLngRect_1.S2LatLngRect(new R1Interval_1.R1Interval(-S2_1.S2.M_PI_4, S2_1.S2.M_PI_4), new S1Interval_1.S1Interval(S2_1.S2.M_PI_4, 3 * S2_1.S2.M_PI_4));
258
- case 2:
259
- return new S2LatLngRect_1.S2LatLngRect(new R1Interval_1.R1Interval(S2Cell.POLE_MIN_LAT, S2_1.S2.M_PI_2), new S1Interval_1.S1Interval(-S2_1.S2.M_PI, S2_1.S2.M_PI));
260
- case 3:
261
- return new S2LatLngRect_1.S2LatLngRect(new R1Interval_1.R1Interval(-S2_1.S2.M_PI_4, S2_1.S2.M_PI_4), new S1Interval_1.S1Interval(3 * S2_1.S2.M_PI_4, -3 * S2_1.S2.M_PI_4));
262
- case 4:
263
- return new S2LatLngRect_1.S2LatLngRect(new R1Interval_1.R1Interval(-S2_1.S2.M_PI_4, S2_1.S2.M_PI_4), new S1Interval_1.S1Interval(-3 * S2_1.S2.M_PI_4, -S2_1.S2.M_PI_4));
264
- default:
265
- return new S2LatLngRect_1.S2LatLngRect(new R1Interval_1.R1Interval(-S2_1.S2.M_PI_2, -S2Cell.POLE_MIN_LAT), new S1Interval_1.S1Interval(-S2_1.S2.M_PI, S2_1.S2.M_PI));
266
- }
267
- }
268
- mayIntersectC(cell) {
269
- return this.cellID.intersects(cell.cellID);
270
- }
271
- contains(p) {
272
- // We can't just call XYZtoFaceUV, because for points that lie on the
273
- // boundary between two faces (i.e. u or v is +1/-1) we need to return
274
- // true for both adjacent cells.
275
- const uvPoint = S2Projections_1.S2Projections.faceXyzToUv(this._face, p);
276
- if (uvPoint == null) {
277
- return false;
278
- }
279
- return (uvPoint.x >= this.uMin
280
- && uvPoint.x <= this.uMax
281
- && uvPoint.y >= this.vMin
282
- && uvPoint.y <= this.vMax);
283
- }
284
- // The point 'p' does not need to be normalized.
285
- containsC(cell) {
286
- return this.cellID.contains(cell.cellID);
287
- }
288
- init(id) {
289
- this.cellID = id;
290
- this._face = id.face;
291
- const ijo = id.toIJOrientation();
292
- this._orientation = S2CellId_1.S2CellId.getOrientation(ijo);
293
- this._level = id.level();
294
- const i = S2CellId_1.S2CellId.getI(ijo);
295
- const j = S2CellId_1.S2CellId.getJ(ijo);
296
- const cellSize = id.getSizeIJ();
297
- this.uMin = S2Projections_1.S2Projections.ijToUV(i, cellSize);
298
- this.uMax = S2Projections_1.S2Projections.ijToUV(i + cellSize, cellSize);
299
- this.vMin = S2Projections_1.S2Projections.ijToUV(j, cellSize);
300
- this.vMax = S2Projections_1.S2Projections.ijToUV(j + cellSize, cellSize);
301
- // for (let d = 0; d < 2; ++d) {
302
- // // Compute the cell bounds in scaled (i,j) coordinates.
303
- // const sijLo = (ij[d].val & -cellSize) * 2 - S2Cell.MAX_CELL_SIZE;
304
- // const sijHi = sijLo + cellSize * 2;
305
- // const s = 1/S2Cell.MAX_CELL_SIZE;
306
- // this._uv[d][0] = R2Vector.singleStTOUV(s * (sijLo))
307
- // //S2Projections.stToUV((1.0 / S2Cell.MAX_CELL_SIZE) * sijLo);
308
- // this._uv[d][1] = R2Vector.singleStTOUV(s * (sijHi));
309
- // //S2Projections.stToUV((1.0 / S2Cell.MAX_CELL_SIZE) * sijHi);
310
- // }
311
- }
312
- get face() {
313
- return this._face;
314
- }
315
- get orientation() {
316
- return this._orientation;
317
- }
318
- get level() {
319
- return this._level;
320
- }
321
- // Return the latitude or longitude of the cell vertex given by (i,j),
322
- // where "i" and "j" are either 0 or 1.
323
- toString() {
324
- return "[" + this._face + ", " + this._level + ", " + this.orientation + ", " + this.cellID + "]";
325
- }
326
- toGEOJSON() {
327
- const coords = [this.getVertex(0), this.getVertex(1), this.getVertex(2), this.getVertex(3), this.getVertex(0)]
328
- .map(v => S2LatLng_1.S2LatLng.fromPoint(v))
329
- .map(v => ([v.lngDegrees, v.latDegrees]));
330
- // const rectJSON = this.getRectBound().toGEOJSON();
331
- return {
332
- type: 'Feature',
333
- geometry: {
334
- type: 'Polygon',
335
- coordinates: [coords]
336
- },
337
- properties: {},
338
- title: `Cell: ${this.id.toToken()} lvl: ${this._level}`
339
- };
340
- // rectJSON.title = `Cell: ${this.id.toToken()}`;
341
- // return rectJSON;
342
- }
343
- }
344
- exports.S2Cell = S2Cell;
345
- S2Cell.MAX_CELL_SIZE = 1 << S2CellId_1.S2CellId.MAX_LEVEL;
346
- // We grow the bounds slightly to make sure that the bounding rectangle
347
- // also contains the normalized versions of the vertices. Note that the
348
- // maximum result magnitude is Pi, with a floating-point exponent of 1.
349
- // Therefore adding or subtracting 2**-51 will always change the result.
350
- // private static MAX_ERROR = S2.toDecimal(1.0).dividedBy(S2.toDecimal(new Long(1).shiftLeft(51).toString()));
351
- S2Cell.MAX_ERROR = 1 / new Long(1).shiftLeft(51).toNumber();
352
- // The 4 cells around the equator extend to +/-45 degrees latitude at the
353
- // midpoints of their top and bottom edges. The two cells covering the
354
- // poles extend down to +/-35.26 degrees at their vertices.
355
- // adding kMaxError (as opposed to the C version) because of asin and atan2
356
- // roundoff errors
357
- S2Cell.POLE_MIN_LAT = Math.asin(Math.sqrt(1 / 3)) - S2Cell.MAX_ERROR;
358
- //# sourceMappingURL=S2Cell.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"S2Cell.js","sourceRoot":"","sources":["../src/S2Cell.ts"],"names":[],"mappings":";;;AAAA,6BAA8B;AAC9B,yCAAoC;AACpC,uCAAkC;AAClC,yCAAoC;AACpC,mDAA8C;AAE9C,6BAAwB;AACxB,iDAA4C;AAC5C,6CAAwC;AACxC,6CAAwC;AACxC,mCAA8B;AAC9B,MAAa,MAAM;IAYjB,YAAoB,MAAgB;QAAhB,WAAM,GAAN,MAAM,CAAU;QAClC,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAA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,CAAC,CAAC,CAAC,CAAC;aACrG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,mBAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;aAC/B,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;QAE7C,oDAAoD;QACpD,OAAO;YACL,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE;gBACR,IAAI,EAAC,SAAS;gBACd,WAAW,EAAE,CAAC,MAAM,CAAC;aACtB;YACD,UAAU,EAAE,EAAE;YACd,KAAK,EAAE,SAAS,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,IAAI,CAAC,MAAM,EAAE;SACxD,CAAC;QACF,iDAAiD;QACjD,mBAAmB;IACrB,CAAC;;AA1aH,wBA4aC;AA3agB,oBAAa,GAAG,CAAC,IAAI,mBAAQ,CAAC,SAAS,CAAC;AA4PzD,uEAAuE;AACvE,uEAAuE;AACvE,uEAAuE;AACvE,wEAAwE;AACxE,gHAAgH;AAC/F,gBAAS,GAAG,CAAC,GAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;AAEpE,yEAAyE;AACzE,sEAAsE;AACtE,2DAA2D;AAC3D,2EAA2E;AAC3E,kBAAkB;AACD,mBAAY,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC"}
@@ -1,290 +0,0 @@
1
- import * as Long from 'long';
2
- import { S2Point } from "./S2Point";
3
- import { R2Vector } from "./R2Vector";
4
- import { MutableInteger } from "./MutableInteger";
5
- import { S2LatLng } from "./S2LatLng";
6
- /**
7
- * An S2CellId is a 64-bit unsigned integer that uniquely identifies a cell in
8
- * the S2 cell decomposition. It has the following format:
9
- *
10
- * <pre>
11
- * id = [face][face_pos]
12
- * </pre>
13
- *
14
- * face: a 3-bit number (range 0..5) encoding the cube face.
15
- *
16
- * face_pos: a 61-bit number encoding the position of the center of this cell
17
- * along the Hilbert curve over this face (see the Wiki pages for details).
18
- *
19
- * Sequentially increasing cell ids follow a continuous space-filling curve over
20
- * the entire sphere. They have the following properties:
21
- * - The id of a cell at level k consists of a 3-bit face number followed by k
22
- * bit pairs that recursively select one of the four children of each cell. The
23
- * next bit is always 1, and all other bits are 0. Therefore, the level of a
24
- * cell is determined by the position of its lowest-numbered bit that is turned
25
- * on (for a cell at level k, this position is 2 * (MAX_LEVEL - k).)
26
- * - The id of a parent cell is at the midpoint of the range of ids spanned by
27
- * its children (or by its descendants at any level).
28
- *
29
- * Leaf cells are often used to represent points on the unit sphere, and this
30
- * class provides methods for converting directly between these two
31
- * representations. For cells that represent 2D regions rather than discrete
32
- * point, it is better to use the S2Cell class.
33
- *
34
- *
35
- */
36
- export declare class S2CellId {
37
- static FACE_BITS: number;
38
- static NUM_FACES: number;
39
- static MAX_LEVEL: number;
40
- static POS_BITS: number;
41
- static MAX_SIZE: number;
42
- private static maxValueDivs;
43
- private static maxValueMods;
44
- static MAX_UNSIGNED: Long.Long;
45
- static LOOKUP_BITS: number;
46
- private static SWAP_MASK;
47
- private static INVERT_MASK;
48
- private static I_SHIFT;
49
- private static J_SHIFT;
50
- private static J_MASK;
51
- private static SI_SHIFT;
52
- private static ORIENTATION_MASK;
53
- private static TI_MASK;
54
- static LOOKUP_POS: Long.Long[];
55
- static LOOKUP_IJ: number[];
56
- /**
57
- * This is the offset required to wrap around from the beginning of the
58
- * Hilbert curve to the end or vice versa; see next_wrap() and prev_wrap().
59
- */
60
- private static WRAP_OFFSET;
61
- id: Long;
62
- constructor(id: Long | string);
63
- /** Which cube face this cell belongs to, in the range 0..5. */
64
- get face(): number;
65
- /** Return the lowest-numbered bit that is on for cells at the given level. */
66
- lowestOnBit(): Long;
67
- static lowestOnBit(id: Long): Long;
68
- /** The default constructor returns an invalid cell id. */
69
- static none(): S2CellId;
70
- /**
71
- * Returns an invalid cell id guaranteed to be larger than any valid cell id.
72
- * Useful for creating indexes.
73
- */
74
- static sentinel(): S2CellId;
75
- private getBits1;
76
- static lowestOnBitForLevel(level: number): Long;
77
- /**
78
- * @deprecated use `toIJOrientation` instead
79
- * Return the (face, i, j) coordinates for the leaf cell corresponding to this
80
- * cell id. Since cells are represented by the Hilbert curve position at the
81
- * center of the cell, the returned (i,j) for non-leaf cells will be a leaf
82
- * cell adjacent to the cell center. If "orientation" is non-NULL, also return
83
- * the Hilbert curve orientation for the current cell.
84
- */
85
- toFaceIJOrientation(pi: MutableInteger, pj: MutableInteger, orientation: MutableInteger): number;
86
- toIJOrientation(): Long;
87
- getI(): number;
88
- static getI(ijo: Long): number;
89
- getJ(): number;
90
- static getJ(ijo: Long): number;
91
- static getOrientation(ijo: Long): number;
92
- /**
93
- * Return true if this is a leaf cell (more efficient than checking whether
94
- * level() == MAX_LEVEL).
95
- */
96
- isLeaf(): boolean;
97
- /**
98
- * Return the cell at the previous level or at the given level (which must be
99
- * less than or equal to the current level).
100
- */
101
- parentL(level: number): S2CellId;
102
- parent(): S2CellId;
103
- /**
104
- * Return a cell given its face (range 0..5), 61-bit Hilbert curve position
105
- * within that face, and level (range 0..MAX_LEVEL). The given position will
106
- * be modified to correspond to the Hilbert curve position at the center of
107
- * the returned cell. This is a static function rather than a constructor in
108
- * order to give names to the arguments.
109
- */
110
- static fromFacePosLevel(face: number, pos: Long, level: number): S2CellId;
111
- static fromFace(face: number): S2CellId;
112
- static fromPoint(p: S2Point): S2CellId;
113
- getCenterUV(): R2Vector;
114
- toPoint(): S2Point;
115
- getCenterSiTi(): Long;
116
- static getSi(center: Long): number;
117
- static getTi(center: Long): number;
118
- /**
119
- * Return the direction vector corresponding to the center of the given cell.
120
- * The vector returned by ToPointRaw is not necessarily unit length.
121
- */
122
- toPointRaw(): S2Point;
123
- /** Return the S2LatLng corresponding to the center of the given cell. */
124
- toLatLng(): S2LatLng;
125
- /** Return true if id() represents a valid cell. */
126
- isValid(): boolean;
127
- /**
128
- * The position of the cell center along the Hilbert curve over this face, in
129
- * the range 0..(2**kPosBits-1).
130
- */
131
- pos(): Long;
132
- /** Return the subdivision level of the cell (range 0..MAX_LEVEL). */
133
- level(): number;
134
- getSizeIJ(): number;
135
- static getSizeIJ(level: number): number;
136
- getSizeST(): number;
137
- static getSizeST(level: number): number;
138
- /**
139
- * Return true if this is a top-level face cell (more efficient than checking
140
- * whether level() == 0).
141
- */
142
- isFace(): boolean;
143
- /**
144
- * Return the child position (0..3) of this cell's ancestor at the given
145
- * level, relative to its parent. The argument should be in the range
146
- * 1..MAX_LEVEL. For example, child_position(1) returns the position of this
147
- * cell's level-1 ancestor within its top-level face cell.
148
- */
149
- childPosition(level: number): number;
150
- rangeMin(): S2CellId;
151
- rangeMax(): S2CellId;
152
- /** Return true if the given cell is contained within this one. */
153
- contains(other: S2CellId): boolean;
154
- /** Return true if the given cell intersects this one. */
155
- intersects(other: S2CellId): boolean;
156
- childBegin(): S2CellId;
157
- childBeginL(level: number): S2CellId;
158
- childEnd(): S2CellId;
159
- childEndL(level: number): S2CellId;
160
- private static childBeginAsLong;
161
- private static childBeginAsLongL;
162
- private static childEndAsLong;
163
- private static childEndAsLongL;
164
- private static fromFaceAsLong;
165
- /**
166
- * Return the next cell at the same level along the Hilbert curve. Works
167
- * correctly when advancing from one face to the next, but does *not* wrap
168
- * around from the last face to the first or vice versa.
169
- */
170
- next(): S2CellId;
171
- /**
172
- * Return the previous cell at the same level along the Hilbert curve. Works
173
- * correctly when advancing from one face to the next, but does *not* wrap
174
- * around from the last face to the first or vice versa.
175
- */
176
- prev(): S2CellId;
177
- /**
178
- * Like next(), but wraps around from the last face to the first and vice
179
- * versa. Should *not* be used for iteration in conjunction with
180
- * child_begin(), child_end(), Begin(), or End().
181
- */
182
- nextWrap(): S2CellId;
183
- /**
184
- * Like prev(), but wraps around from the last face to the first and vice
185
- * versa. Should *not* be used for iteration in conjunction with
186
- * child_begin(), child_end(), Begin(), or End().
187
- */
188
- prevWrap(): S2CellId;
189
- static begin(level: number): S2CellId;
190
- static end(level: number): S2CellId;
191
- /**
192
- * Decodes the cell id from a compact text string suitable for display or
193
- * indexing. Cells at lower levels (i.e. larger cells) are encoded into
194
- * fewer characters. The maximum token length is 16.
195
- *
196
- * @param token the token to decode
197
- * @return the S2CellId for that token
198
- * @throws NumberFormatException if the token is not formatted correctly
199
- */
200
- static fromToken(token: string): S2CellId;
201
- /**
202
- * Encodes the cell id to compact text strings suitable for display or indexing.
203
- * Cells at lower levels (i.e. larger cells) are encoded into fewer characters.
204
- * The maximum token length is 16.
205
- *
206
- * Simple implementation: convert the id to hex and strip trailing zeros. We
207
- * could use base-32 or base-64, but assuming the cells used for indexing
208
- * regions are at least 100 meters across (level 16 or less), the savings
209
- * would be at most 3 bytes (9 bytes hex vs. 6 bytes base-64).
210
- *
211
- * @return the encoded cell id
212
- */
213
- toToken(): string;
214
- /**
215
- * Returns true if (current * radix) + digit is a number too large to be
216
- * represented by an unsigned long. This is useful for detecting overflow
217
- * while parsing a string representation of a number.
218
- * Does not verify whether supplied radix is valid, passing an invalid radix
219
- * will give undefined results or an ArrayIndexOutOfBoundsException.
220
- */
221
- private static overflowInParse;
222
- /**
223
- * Return the four cells that are adjacent across the cell's four edges.
224
- * Neighbors are returned in the order defined by S2Cell::GetEdge. All
225
- * neighbors are guaranteed to be distinct.
226
- */
227
- getEdgeNeighbors(): S2CellId[];
228
- /**
229
- * Return the neighbors of closest vertex to this cell at the given level, by
230
- * appending them to "output". Normally there are four neighbors, but the
231
- * closest vertex may only have three neighbors if it is one of the 8 cube
232
- * vertices.
233
- *
234
- * Requires: level < this.evel(), so that we can determine which vertex is
235
- * closest (in particular, level == MAX_LEVEL is not allowed).
236
- */
237
- getVertexNeighbors(level: number): S2CellId[];
238
- /**
239
- * Append all neighbors of this cell at the given level to "output". Two cells
240
- * X and Y are neighbors if their boundaries intersect but their interiors do
241
- * not. In particular, two cells that intersect at a single point are
242
- * neighbors.
243
- *
244
- * Requires: nbr_level >= this->level(). Note that for cells adjacent to a
245
- * face vertex, the same neighbor may be appended more than once.
246
- */
247
- getAllNeighbors(nbrLevel: number): S2CellId[];
248
- /**
249
- * Return a leaf cell given its cube face (range 0..5) and i- and
250
- * j-coordinates (see s2.h).
251
- */
252
- static fromFaceIJ(face: number, i: number, j: number): S2CellId;
253
- private static getBits;
254
- /**
255
- * Return the i- or j-index of the leaf cell containing the given s- or
256
- * t-value.
257
- */
258
- private static stToIJ;
259
- /**
260
- * Given (i, j) coordinates that may be out of bounds, normalize them by
261
- * returning the corresponding neighbor cell on an adjacent face.
262
- */
263
- private static fromFaceIJWrap;
264
- /**
265
- * Public helper function that calls FromFaceIJ if sameFace is true, or
266
- * FromFaceIJWrap if sameFace is false.
267
- */
268
- static fromFaceIJSame(face: number, i: number, j: number, sameFace: boolean): S2CellId;
269
- /**
270
- * Returns true if x1 < x2, when both values are treated as unsigned.
271
- */
272
- static unsignedLongLessThan(x1: Long, x2: Long): boolean;
273
- /**
274
- * Returns true if x1 > x2, when both values are treated as unsigned.
275
- */
276
- static unsignedLongGreaterThan(x1: Long, x2: Long): boolean;
277
- lessThan(x: S2CellId): boolean;
278
- greaterThan(x: S2CellId): boolean;
279
- lessOrEquals(x: S2CellId): boolean;
280
- greaterOrEquals(x: S2CellId): boolean;
281
- toString(): string;
282
- compareTo(that: S2CellId): number;
283
- equals(that: S2CellId): boolean;
284
- /**
285
- * Returns the position of the id within the given list or a negative value with
286
- * the position of the index wher eit should be entered if the id was present
287
- */
288
- static binarySearch(ids: S2CellId[], _id: Long | string | S2CellId, low?: number): number;
289
- static indexedBinarySearch(ids: S2CellId[], id: Long | string | S2CellId, low?: number): number;
290
- }