nodes2ts 2.0.0 → 4.0.0

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 (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +116 -13
  3. package/dist/export.cjs +5331 -0
  4. package/dist/export.cjs.map +1 -0
  5. package/dist/export.d.cts +1838 -0
  6. package/dist/export.d.ts +1828 -20
  7. package/dist/export.js +5279 -51
  8. package/dist/export.js.map +1 -1
  9. package/package.json +34 -49
  10. package/dist/Interval.d.ts +0 -24
  11. package/dist/Interval.js +0 -22
  12. package/dist/Interval.js.map +0 -1
  13. package/dist/MutableInteger.d.ts +0 -4
  14. package/dist/MutableInteger.js +0 -9
  15. package/dist/MutableInteger.js.map +0 -1
  16. package/dist/R1Interval.d.ts +0 -76
  17. package/dist/R1Interval.js +0 -167
  18. package/dist/R1Interval.js.map +0 -1
  19. package/dist/R2Vector.d.ts +0 -34
  20. package/dist/R2Vector.js +0 -138
  21. package/dist/R2Vector.js.map +0 -1
  22. package/dist/S1Angle.d.ts +0 -26
  23. package/dist/S1Angle.js +0 -78
  24. package/dist/S1Angle.js.map +0 -1
  25. package/dist/S1Interval.d.ts +0 -109
  26. package/dist/S1Interval.js +0 -403
  27. package/dist/S1Interval.js.map +0 -1
  28. package/dist/S2.d.ts +0 -91
  29. package/dist/S2.js +0 -236
  30. package/dist/S2.js.map +0 -1
  31. package/dist/S2Cap.d.ts +0 -113
  32. package/dist/S2Cap.js +0 -392
  33. package/dist/S2Cap.js.map +0 -1
  34. package/dist/S2Cell.d.ts +0 -103
  35. package/dist/S2Cell.js +0 -361
  36. package/dist/S2Cell.js.map +0 -1
  37. package/dist/S2CellId.d.ts +0 -267
  38. package/dist/S2CellId.js +0 -933
  39. package/dist/S2CellId.js.map +0 -1
  40. package/dist/S2CellUnion.d.ts +0 -180
  41. package/dist/S2CellUnion.js +0 -518
  42. package/dist/S2CellUnion.js.map +0 -1
  43. package/dist/S2EdgeUtil.d.ts +0 -17
  44. package/dist/S2EdgeUtil.js +0 -787
  45. package/dist/S2EdgeUtil.js.map +0 -1
  46. package/dist/S2LatLng.d.ts +0 -72
  47. package/dist/S2LatLng.js +0 -182
  48. package/dist/S2LatLng.js.map +0 -1
  49. package/dist/S2LatLngRect.d.ts +0 -185
  50. package/dist/S2LatLngRect.js +0 -605
  51. package/dist/S2LatLngRect.js.map +0 -1
  52. package/dist/S2Metric.d.ts +0 -38
  53. package/dist/S2Metric.js +0 -75
  54. package/dist/S2Metric.js.map +0 -1
  55. package/dist/S2Point.d.ts +0 -43
  56. package/dist/S2Point.js +0 -200
  57. package/dist/S2Point.js.map +0 -1
  58. package/dist/S2Projections.d.ts +0 -67
  59. package/dist/S2Projections.js +0 -152
  60. package/dist/S2Projections.js.map +0 -1
  61. package/dist/S2Region.d.ts +0 -31
  62. package/dist/S2Region.js +0 -17
  63. package/dist/S2Region.js.map +0 -1
  64. package/dist/S2RegionCoverer.d.ts +0 -171
  65. package/dist/S2RegionCoverer.js +0 -435
  66. package/dist/S2RegionCoverer.js.map +0 -1
  67. package/yarn.lock +0 -4381
@@ -1,38 +0,0 @@
1
- /**
2
- * Defines an area or a length cell metric.
3
- */
4
- export declare class S2Metric {
5
- private _dim;
6
- private _deriv;
7
- /**
8
- * Defines a cell metric of the given dimension (1 == length, 2 == area).
9
- */
10
- constructor(_dim: number, _deriv: number);
11
- deriv(): number;
12
- dim(): number;
13
- /** Return the value of a metric for cells at the given level. */
14
- getValue(level: number): number;
15
- /**
16
- * Return the level at which the metric has approximately the given value.
17
- * For example, S2::kAvgEdge.GetClosestLevel(0.1) returns the level at which
18
- * the average cell edge length is approximately 0.1. The return value is
19
- * always a valid level.
20
- */
21
- getClosestLevel(value: number): number;
22
- /**
23
- * Return the minimum level such that the metric is at most the given value,
24
- * or S2CellId::kMaxLevel if there is no such level. For example,
25
- * S2::kMaxDiag.GetMinLevel(0.1) returns the minimum level such that all
26
- * cell diagonal lengths are 0.1 or smaller. The return value is always a
27
- * valid level.
28
- */
29
- getMinLevel(value: number): number;
30
- /**
31
- * Return the maximum level such that the metric is at least the given
32
- * value, or zero if there is no such level. For example,
33
- * S2.kMinWidth.GetMaxLevel(0.1) returns the maximum level such that all
34
- * cells have a minimum width of 0.1 or larger. The return value is always a
35
- * valid level.
36
- */
37
- getMaxLevel(value: number): number;
38
- }
package/dist/S2Metric.js DELETED
@@ -1,75 +0,0 @@
1
- "use strict";
2
- var S2_1 = require("./S2");
3
- /**
4
- * Defines an area or a length cell metric.
5
- */
6
- var S2Metric = (function () {
7
- /**
8
- * Defines a cell metric of the given dimension (1 == length, 2 == area).
9
- */
10
- function S2Metric(_dim, _deriv) {
11
- this._dim = _dim;
12
- this._deriv = _deriv;
13
- }
14
- S2Metric.prototype.deriv = function () {
15
- return this._deriv;
16
- };
17
- S2Metric.prototype.dim = function () {
18
- return this._dim;
19
- };
20
- /** Return the value of a metric for cells at the given level. */
21
- S2Metric.prototype.getValue = function (level) {
22
- var scaleFactor = this.dim() * (1 - level);
23
- return this.deriv() * (Math.pow(2, scaleFactor));
24
- };
25
- /**
26
- * Return the level at which the metric has approximately the given value.
27
- * For example, S2::kAvgEdge.GetClosestLevel(0.1) returns the level at which
28
- * the average cell edge length is approximately 0.1. The return value is
29
- * always a valid level.
30
- */
31
- S2Metric.prototype.getClosestLevel = function (/*double*/ value) {
32
- return this.getMinLevel(S2_1.S2.M_SQRT2 * value);
33
- };
34
- /**
35
- * Return the minimum level such that the metric is at most the given value,
36
- * or S2CellId::kMaxLevel if there is no such level. For example,
37
- * S2::kMaxDiag.GetMinLevel(0.1) returns the minimum level such that all
38
- * cell diagonal lengths are 0.1 or smaller. The return value is always a
39
- * valid level.
40
- */
41
- S2Metric.prototype.getMinLevel = function (value /*double*/) {
42
- if (value <= 0) {
43
- return S2_1.S2.MAX_LEVEL;
44
- }
45
- // This code is equivalent to computing a floating-point "level"
46
- // value and rounding up.
47
- var exponent = S2_1.S2.exp(value / ((1 << this.dim()) * this.deriv()));
48
- var level = Math.max(0, Math.min(S2_1.S2.MAX_LEVEL, -((exponent - 1) >> (this.dim() - 1))));
49
- // assert (level == S2CellId.MAX_LEVEL || getValue(level) <= value);
50
- // assert (level == 0 || getValue(level - 1) > value);
51
- return level;
52
- };
53
- /**
54
- * Return the maximum level such that the metric is at least the given
55
- * value, or zero if there is no such level. For example,
56
- * S2.kMinWidth.GetMaxLevel(0.1) returns the maximum level such that all
57
- * cells have a minimum width of 0.1 or larger. The return value is always a
58
- * valid level.
59
- */
60
- S2Metric.prototype.getMaxLevel = function (value /*double*/) {
61
- if (value <= 0) {
62
- return S2_1.S2.MAX_LEVEL;
63
- }
64
- // This code is equivalent to computing a floating-point "level"
65
- // value and rounding down.
66
- var exponent = S2_1.S2.exp((1 << this.dim()) * this.deriv() / value);
67
- var level = Math.max(0, Math.min(S2_1.S2.MAX_LEVEL, ((exponent - 1) >> (this.dim() - 1))));
68
- // assert (level == 0 || getValue(level) >= value);
69
- // assert (level == S2CellId.MAX_LEVEL || getValue(level + 1) < value);
70
- return level;
71
- };
72
- return S2Metric;
73
- }());
74
- exports.S2Metric = S2Metric;
75
- //# sourceMappingURL=S2Metric.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"S2Metric.js","sourceRoot":"","sources":["../src/S2Metric.ts"],"names":[],"mappings":";AAAA,mBAAiB,MAAM,CAAC,CAAA;AACxB;;GAEG;AACH;IAII;;OAEG;IACH,kBAAmB,IAAW,EAAE,MAAa;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IAEzB,CAAC;IAED,wBAAK,GAAL;QACI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,sBAAG,GAAH;QACI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,iEAAiE;IAC1D,2BAAQ,GAAf,UAAgB,KAAY;QACxB,IAAI,WAAW,GAAG,IAAI,CAAC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G,OAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,CAAC;QAChE,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAClB,IAAI,CAAC,GAAG,CAAC,OAAE,CAAC,SAAS,EAAE,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClE,mDAAmD;QACnD,uEAAuE;QACvE,MAAM,CAAC,KAAK,CAAC;IACjB,CAAC;IACL,eAAC;AAAD,CAAC,AAjFD,IAiFC;AAjFY,gBAAQ,WAiFpB,CAAA"}
package/dist/S2Point.d.ts DELETED
@@ -1,43 +0,0 @@
1
- import { R2Vector } from "./R2Vector";
2
- /**
3
- * An S2Point represents a point on the unit sphere as a 3D vector. Usually
4
- * points are normalized to be unit length, but some methods do not require
5
- * this.
6
- *
7
- */
8
- export declare class S2Point {
9
- x: number;
10
- y: number;
11
- z: number;
12
- constructor(x: number, y: number, z: number);
13
- static minus(p1: S2Point, p2: S2Point): S2Point;
14
- static neg(p: S2Point): S2Point;
15
- norm2(): number;
16
- norm(): number;
17
- static crossProd(p1: S2Point, p2: S2Point): S2Point;
18
- static add(p1: S2Point, p2: S2Point): S2Point;
19
- static sub(p1: S2Point, p2: S2Point): S2Point;
20
- dotProd(that: S2Point): number;
21
- static mul(p: any, m: number): S2Point;
22
- static div(p: S2Point, m: number): S2Point;
23
- /** return a vector orthogonal to this one */
24
- ortho(): S2Point;
25
- /** Return the index of the largest component fabs */
26
- largestAbsComponent(): number;
27
- static fabs(p: S2Point): S2Point;
28
- static normalize(p: S2Point): S2Point;
29
- axis(axis: number): number;
30
- /** Return the angle between two vectors in radians */
31
- angle(va: any): number;
32
- /**
33
- * Compare two vectors, return true if all their components are within a
34
- * difference of margin.
35
- */
36
- aequal(that: S2Point, margin: number): boolean;
37
- equals(that: S2Point): boolean;
38
- lessThan(vb: S2Point): boolean;
39
- compareTo(other: S2Point): number;
40
- toFace(): number;
41
- toR2Vector(face?: number): R2Vector;
42
- toString(): string;
43
- }
package/dist/S2Point.js DELETED
@@ -1,200 +0,0 @@
1
- /*
2
- * Copyright 2006 Google Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- "use strict";
17
- var R2Vector_1 = require("./R2Vector");
18
- ///re
19
- /**
20
- * An S2Point represents a point on the unit sphere as a 3D vector. Usually
21
- * points are normalized to be unit length, but some methods do not require
22
- * this.
23
- *
24
- */
25
- var S2Point = (function () {
26
- function S2Point(x, y, z) {
27
- this.x = (x);
28
- this.y = (y);
29
- this.z = (z);
30
- // this.y = typeof(y) === 'number'?new Decimal(y):y as Decimal;
31
- // this.z = typeof(z) === 'number'?new Decimal(z):z as Decimal;
32
- }
33
- S2Point.minus = function (p1, p2) {
34
- return S2Point.sub(p1, p2);
35
- };
36
- S2Point.neg = function (p) {
37
- return new S2Point(p.x * -1, p.y * -1, p.z * -1);
38
- };
39
- S2Point.prototype.norm2 = function () {
40
- return Math.pow(this.x, 2) + Math.pow(this.y, 2) + Math.pow(this.z, 2);
41
- };
42
- S2Point.prototype.norm = function () {
43
- return Math.sqrt(this.norm2());
44
- };
45
- S2Point.crossProd = function (p1, p2) {
46
- return new S2Point(p1.y * (p2.z) - (p1.z * (p2.y)), p1.z * (p2.x) - (p1.x * (p2.z)),
47
- // p1.z * p2.x - p1.x * p2.z,
48
- p1.x * (p2.y) - (p1.y * (p2.x)));
49
- };
50
- S2Point.add = function (p1, p2) {
51
- return new S2Point(p1.x + p2.x, p1.y + p2.y, p1.z + p2.z);
52
- };
53
- S2Point.sub = function (p1, p2) {
54
- return new S2Point(p1.x - p2.x, p1.y - p2.y, p1.z - p2.z);
55
- };
56
- S2Point.prototype.dotProd = function (that) {
57
- return this.x * (that.x) + (this.y * that.y) + (this.z * (that.z));
58
- };
59
- S2Point.mul = function (p, m) {
60
- return new S2Point(m * (p.x), m * (p.y), m * (p.z));
61
- };
62
- S2Point.div = function (p, m) {
63
- return new S2Point(p.x / (m), p.y / (m), p.z / (m));
64
- };
65
- /** return a vector orthogonal to this one */
66
- S2Point.prototype.ortho = function () {
67
- var k = this.largestAbsComponent();
68
- var temp;
69
- if (k == 1) {
70
- temp = new S2Point(1, 0, 0);
71
- }
72
- else if (k == 2) {
73
- temp = new S2Point(0, 1, 0);
74
- }
75
- else {
76
- temp = new S2Point(0, 0, 1);
77
- }
78
- return S2Point.normalize(S2Point.crossProd(this, temp));
79
- };
80
- /** Return the index of the largest component fabs */
81
- S2Point.prototype.largestAbsComponent = function () {
82
- var temp = S2Point.fabs(this);
83
- if (temp.x > (temp.y)) {
84
- if (temp.x > (temp.z)) {
85
- return 0;
86
- }
87
- else {
88
- return 2;
89
- }
90
- }
91
- else {
92
- if (temp.y > (temp.z)) {
93
- return 1;
94
- }
95
- else {
96
- return 2;
97
- }
98
- }
99
- };
100
- S2Point.fabs = function (p) {
101
- return new S2Point(Math.abs(p.x), Math.abs(p.y), Math.abs(p.z));
102
- };
103
- S2Point.normalize = function (p) {
104
- var norm = p.norm();
105
- if (norm != (0)) {
106
- norm = 1 / norm;
107
- }
108
- return S2Point.mul(p, norm);
109
- };
110
- S2Point.prototype.axis = function (axis) {
111
- return (axis == 0) ? this.x : (axis == 1) ? this.y : this.z;
112
- };
113
- /** Return the angle between two vectors in radians */
114
- S2Point.prototype.angle = function (va) {
115
- return Math.atan2(S2Point.crossProd(this, va).norm(), this.dotProd(va));
116
- };
117
- /**
118
- * Compare two vectors, return true if all their components are within a
119
- * difference of margin.
120
- */
121
- S2Point.prototype.aequal = function (that, margin) {
122
- return this.x - Math.abs(that.x) < (margin) &&
123
- this.y - Math.abs(that.y) < (margin) &&
124
- this.z - Math.abs(that.z) < (margin);
125
- };
126
- S2Point.prototype.equals = function (that) {
127
- if (!(that instanceof S2Point)) {
128
- return false;
129
- }
130
- return this.x == (that.x) && this.y == (that.y) && this.z == (that.z);
131
- };
132
- S2Point.prototype.lessThan = function (vb) {
133
- if (this.x < (vb.x)) {
134
- return true;
135
- }
136
- if (vb.x < (this.x)) {
137
- return false;
138
- }
139
- if (this.y < (vb.y)) {
140
- return true;
141
- }
142
- if (vb.y < (this.y)) {
143
- return false;
144
- }
145
- if (this.z < (vb.z)) {
146
- return true;
147
- }
148
- return false;
149
- };
150
- S2Point.prototype.compareTo = function (other) {
151
- return (this.lessThan(other) ? -1 : (this.equals(other) ? 0 : 1));
152
- };
153
- S2Point.prototype.toFace = function () {
154
- var face = this.largestAbsComponent();
155
- if (this.axis(face) < (0)) {
156
- face += 3;
157
- }
158
- return face;
159
- };
160
- S2Point.prototype.toR2Vector = function (face) {
161
- if (face === void 0) { face = this.toFace(); }
162
- var u;
163
- var v;
164
- switch (face) {
165
- case 0:
166
- u = this.y / (this.x);
167
- v = this.z / (this.x);
168
- break;
169
- case 1:
170
- u = (this.x * -1) / (this.y);
171
- v = this.z / (this.y);
172
- break;
173
- case 2:
174
- u = (this.x * -1) / (this.z);
175
- v = (this.y * -1) / (this.z);
176
- break;
177
- case 3:
178
- u = this.z / (this.x);
179
- v = this.y / (this.x);
180
- break;
181
- case 4:
182
- u = this.z / (this.y);
183
- v = (this.x * -1) / (this.y);
184
- break;
185
- case 5:
186
- u = (this.y * -1) / (this.z);
187
- v = (this.x * -1) / (this.z);
188
- break;
189
- default:
190
- throw new Error('Invalid face');
191
- }
192
- return new R2Vector_1.R2Vector(u, v);
193
- };
194
- S2Point.prototype.toString = function () {
195
- return "Point(" + this.x + ", " + this.y + ", " + this.z + ")";
196
- };
197
- return S2Point;
198
- }());
199
- exports.S2Point = S2Point;
200
- //# sourceMappingURL=S2Point.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"S2Point.js","sourceRoot":"","sources":["../src/S2Point.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAEH,yBAAuB,YAAY,CAAC,CAAA;AAEpC,KAAK;AACL;;;;;GAKG;AACH;IAIE,iBAAY,CAAQ,EAAE,CAAQ,EAAE,CAAQ;QACtC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACb,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACb,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACb,+DAA+D;QAC/D,+DAA+D;IACjE,CAAC;IAEM,aAAK,GAAZ,UAAa,EAAU,EAAE,EAAU;QACjC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7B,CAAC;IAEM,WAAG,GAAV,UAAW,CAAU;QACnB,MAAM,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;IAEM,uBAAK,GAAZ;QACE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACzE,CAAC;IAEM,sBAAI,GAAX;QACE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IACjC,CA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CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAC7B,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAC7B,KAAK,CAAC;YACR;gBACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;QACpC,CAAC;QACD,MAAM,CAAC,IAAI,mBAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5B,CAAC;IAGD,0BAAQ,GAAR;QACE,MAAM,CAAC,WAAS,IAAI,CAAC,CAAC,UAAK,IAAI,CAAC,CAAC,UAAK,IAAI,CAAC,CAAC,MAAG,CAAC;IAClD,CAAC;IACH,cAAC;AAAD,CAAC,AAxMD,IAwMC;AAxMY,eAAO,UAwMnB,CAAA"}
@@ -1,67 +0,0 @@
1
- /**
2
- * This class specifies the details of how the cube faces are projected onto the
3
- * unit sphere. This includes getting the face ordering and orientation correct
4
- * so that sequentially increasing cell ids follow a continuous space-filling
5
- * curve over the entire sphere, and defining the transformation from cell-space
6
- * to cube-space (see s2.h) in order to make the cells more uniform in size.
7
- *
8
- *
9
- * We have implemented three different projections from cell-space (s,t) to
10
- * cube-space (u,v): linear, quadratic, and tangent. They have the following
11
- * tradeoffs:
12
- *
13
- * Linear - This is the fastest transformation, but also produces the least
14
- * uniform cell sizes. Cell areas vary by a factor of about 5.2, with the
15
- * largest cells at the center of each face and the smallest cells in the
16
- * corners.
17
- *
18
- * Tangent - Transforming the coordinates via atan() makes the cell sizes more
19
- * uniform. The areas vary by a maximum ratio of 1.4 as opposed to a maximum
20
- * ratio of 5.2. However, each call to atan() is about as expensive as all of
21
- * the other calculations combined when converting from points to cell ids, i.e.
22
- * it reduces performance by a factor of 3.
23
- *
24
- * Quadratic - This is an approximation of the tangent projection that is much
25
- * faster and produces cells that are almost as uniform in size. It is about 3
26
- * times faster than the tangent projection for converting cell ids to points,
27
- * and 2 times faster for converting points to cell ids. Cell areas vary by a
28
- * maximum ratio of about 2.1.
29
- *
30
- * Here is a table comparing the cell uniformity using each projection. "Area
31
- * ratio" is the maximum ratio over all subdivision levels of the largest cell
32
- * area to the smallest cell area at that level, "edge ratio" is the maximum
33
- * ratio of the longest edge of any cell to the shortest edge of any cell at the
34
- * same level, and "diag ratio" is the ratio of the longest diagonal of any cell
35
- * to the shortest diagonal of any cell at the same level. "ToPoint" and
36
- * "FromPoint" are the times in microseconds required to convert cell ids to and
37
- * from points (unit vectors) respectively.
38
- *
39
- * Area Edge Diag ToPoint FromPoint Ratio Ratio Ratio (microseconds)
40
- * ------------------------------------------------------- Linear: 5.200 2.117
41
- * 2.959 0.103 0.123 Tangent: 1.414 1.414 1.704 0.290 0.306 Quadratic: 2.082
42
- * 1.802 1.932 0.116 0.161
43
- *
44
- * The worst-case cell aspect ratios are about the same with all three
45
- * projections. The maximum ratio of the longest edge to the shortest edge
46
- * within the same cell is about 1.4 and the maximum ratio of the diagonals
47
- * within the same cell is about 1.7.
48
- *
49
- * This data was produced using s2cell_unittest and s2cellid_unittest.
50
- *
51
- */
52
- import { S2Metric } from "./S2";
53
- import { S2Point } from "./S2Point";
54
- export declare enum Projections {
55
- S2_LINEAR_PROJECTION = 0,
56
- S2_TAN_PROJECTION = 1,
57
- S2_QUADRATIC_PROJECTION = 2,
58
- }
59
- export declare class S2Projections {
60
- static MIN_WIDTH: S2Metric;
61
- static AVG_AREA: S2Metric;
62
- static getUNorm(face: number, u: number): S2Point;
63
- static getVNorm(face: number, v: number): S2Point;
64
- static getUAxis(face: number): S2Point;
65
- static getVAxis(face: number): S2Point;
66
- static faceUvToXyz(face: number, u: number, v: number): S2Point;
67
- }
@@ -1,152 +0,0 @@
1
- /*
2
- * Copyright 2005 Google Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- "use strict";
17
- /**
18
- * This class specifies the details of how the cube faces are projected onto the
19
- * unit sphere. This includes getting the face ordering and orientation correct
20
- * so that sequentially increasing cell ids follow a continuous space-filling
21
- * curve over the entire sphere, and defining the transformation from cell-space
22
- * to cube-space (see s2.h) in order to make the cells more uniform in size.
23
- *
24
- *
25
- * We have implemented three different projections from cell-space (s,t) to
26
- * cube-space (u,v): linear, quadratic, and tangent. They have the following
27
- * tradeoffs:
28
- *
29
- * Linear - This is the fastest transformation, but also produces the least
30
- * uniform cell sizes. Cell areas vary by a factor of about 5.2, with the
31
- * largest cells at the center of each face and the smallest cells in the
32
- * corners.
33
- *
34
- * Tangent - Transforming the coordinates via atan() makes the cell sizes more
35
- * uniform. The areas vary by a maximum ratio of 1.4 as opposed to a maximum
36
- * ratio of 5.2. However, each call to atan() is about as expensive as all of
37
- * the other calculations combined when converting from points to cell ids, i.e.
38
- * it reduces performance by a factor of 3.
39
- *
40
- * Quadratic - This is an approximation of the tangent projection that is much
41
- * faster and produces cells that are almost as uniform in size. It is about 3
42
- * times faster than the tangent projection for converting cell ids to points,
43
- * and 2 times faster for converting points to cell ids. Cell areas vary by a
44
- * maximum ratio of about 2.1.
45
- *
46
- * Here is a table comparing the cell uniformity using each projection. "Area
47
- * ratio" is the maximum ratio over all subdivision levels of the largest cell
48
- * area to the smallest cell area at that level, "edge ratio" is the maximum
49
- * ratio of the longest edge of any cell to the shortest edge of any cell at the
50
- * same level, and "diag ratio" is the ratio of the longest diagonal of any cell
51
- * to the shortest diagonal of any cell at the same level. "ToPoint" and
52
- * "FromPoint" are the times in microseconds required to convert cell ids to and
53
- * from points (unit vectors) respectively.
54
- *
55
- * Area Edge Diag ToPoint FromPoint Ratio Ratio Ratio (microseconds)
56
- * ------------------------------------------------------- Linear: 5.200 2.117
57
- * 2.959 0.103 0.123 Tangent: 1.414 1.414 1.704 0.290 0.306 Quadratic: 2.082
58
- * 1.802 1.932 0.116 0.161
59
- *
60
- * The worst-case cell aspect ratios are about the same with all three
61
- * projections. The maximum ratio of the longest edge to the shortest edge
62
- * within the same cell is about 1.4 and the maximum ratio of the diagonals
63
- * within the same cell is about 1.7.
64
- *
65
- * This data was produced using s2cell_unittest and s2cellid_unittest.
66
- *
67
- */
68
- var S2_1 = require("./S2");
69
- var S2Point_1 = require("./S2Point");
70
- var R2Vector_1 = require("./R2Vector");
71
- (function (Projections) {
72
- Projections[Projections["S2_LINEAR_PROJECTION"] = 0] = "S2_LINEAR_PROJECTION";
73
- Projections[Projections["S2_TAN_PROJECTION"] = 1] = "S2_TAN_PROJECTION";
74
- Projections[Projections["S2_QUADRATIC_PROJECTION"] = 2] = "S2_QUADRATIC_PROJECTION";
75
- })(exports.Projections || (exports.Projections = {}));
76
- var Projections = exports.Projections;
77
- var S2Projections = (function () {
78
- function S2Projections() {
79
- }
80
- S2Projections.getUNorm = function (face, u) {
81
- switch (face) {
82
- case 0:
83
- return new S2Point_1.S2Point(u, -1, 0);
84
- case 1:
85
- return new S2Point_1.S2Point(1, u, 0);
86
- case 2:
87
- return new S2Point_1.S2Point(1, 0, u);
88
- case 3:
89
- return new S2Point_1.S2Point(-u, 0, 1);
90
- case 4:
91
- return new S2Point_1.S2Point(0, -u, 1);
92
- default:
93
- return new S2Point_1.S2Point(0, -1, -u);
94
- }
95
- };
96
- S2Projections.getVNorm = function (face, v) {
97
- switch (face) {
98
- case 0:
99
- return new S2Point_1.S2Point(-v, 0, 1);
100
- case 1:
101
- return new S2Point_1.S2Point(0, -v, 1);
102
- case 2:
103
- return new S2Point_1.S2Point(0, -1, -v);
104
- case 3:
105
- return new S2Point_1.S2Point(v, -1, 0);
106
- case 4:
107
- return new S2Point_1.S2Point(1, v, 0);
108
- default:
109
- return new S2Point_1.S2Point(1, 0, v);
110
- }
111
- };
112
- S2Projections.getUAxis = function (face) {
113
- switch (face) {
114
- case 0:
115
- return new S2Point_1.S2Point(0, 1, 0);
116
- case 1:
117
- return new S2Point_1.S2Point(-1, 0, 0);
118
- case 2:
119
- return new S2Point_1.S2Point(-1, 0, 0);
120
- case 3:
121
- return new S2Point_1.S2Point(0, 0, -1);
122
- case 4:
123
- return new S2Point_1.S2Point(0, 0, -1);
124
- default:
125
- return new S2Point_1.S2Point(0, 1, 0);
126
- }
127
- };
128
- S2Projections.getVAxis = function (face) {
129
- switch (face) {
130
- case 0:
131
- return new S2Point_1.S2Point(0, 0, 1);
132
- case 1:
133
- return new S2Point_1.S2Point(0, 0, 1);
134
- case 2:
135
- return new S2Point_1.S2Point(0, -1, 0);
136
- case 3:
137
- return new S2Point_1.S2Point(0, -1, 0);
138
- case 4:
139
- return new S2Point_1.S2Point(1, 0, 0);
140
- default:
141
- return new S2Point_1.S2Point(1, 0, 0);
142
- }
143
- };
144
- S2Projections.faceUvToXyz = function (face, u, v) {
145
- return new R2Vector_1.R2Vector(u, v).toPoint(face);
146
- };
147
- S2Projections.MIN_WIDTH = new S2_1.S2Metric(1, S2_1.S2.M_SQRT2 / 3);
148
- S2Projections.AVG_AREA = new S2_1.S2Metric(2, S2_1.S2.M_PI / 6); // 0.524)
149
- return S2Projections;
150
- }());
151
- exports.S2Projections = S2Projections;
152
- //# sourceMappingURL=S2Projections.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"S2Projections.js","sourceRoot":"","sources":["../src/S2Projections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAGH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,mBAA2B,MAAM,CAAC,CAAA;AAClC,wBAAsB,WAAW,CAAC,CAAA;AAClC,yBAAuB,YAAY,CAAC,CAAA;AACpC,WAAY,WAAW;IACrB,6EAAoB,CAAA;IAAE,uEAAiB,CAAA;IAAE,mFAAuB,CAAA;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AC;YAC9B,KAAK,CAAC;gBACJ,MAAM,CAAC,IAAI,iBAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC9B,KAAK,CAAC;gBACJ,MAAM,CAAC,IAAI,iBAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC/B,KAAK,CAAC;gBACJ,MAAM,CAAC,IAAI,iBAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC/B,KAAK,CAAC;gBACJ,MAAM,CAAC,IAAI,iBAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC9B;gBACE,MAAM,CAAC,IAAI,iBAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;IAEa,yBAAW,GAAzB,UAA0B,IAAY,EAAE,CAAQ,EAAE,CAAQ;QACxD,MAAM,CAAC,IAAI,mBAAQ,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IA1Ea,uBAAS,GAAE,IAAI,aAAQ,CAAC,CAAC,EAAC,OAAE,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;IAC1C,sBAAQ,GAAG,IAAI,aAAQ,CAAC,CAAC,EAAE,OAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;IA0ElE,oBAAC;AAAD,CAAC,AA7ED,IA6EC;AA7EY,qBAAa,gBA6EzB,CAAA"}
@@ -1,31 +0,0 @@
1
- import { S2Cell } from "./S2Cell";
2
- import { S2Cap } from "./S2Cap";
3
- /**
4
- * An S2Region represents a two-dimensional region over the unit sphere. It is
5
- * an abstract interface with various concrete subtypes.
6
- *
7
- * The main purpose of this interface is to allow complex regions to be
8
- * approximated as simpler regions. So rather than having a wide variety of
9
- * virtual methods that are implemented by all subtypes, the interface is
10
- * restricted to methods that are useful for computing approximations.
11
- *
12
- *
13
- */
14
- export interface S2Region {
15
- /** Return a bounding spherical cap. */
16
- getCapBound(): S2Cap;
17
- /** Return a bounding latitude-longitude rectangle. */
18
- getRectBound(): any;
19
- /**
20
- * If this method returns true, the region completely contains the given cell.
21
- * Otherwise, either the region does not contain the cell or the containment
22
- * relationship could not be determined.
23
- */
24
- containsC(cell: S2Cell): boolean;
25
- /**
26
- * If this method returns false, the region does not intersect the given cell.
27
- * Otherwise, either region intersects the cell, or the intersection
28
- * relationship could not be determined.
29
- */
30
- mayIntersectC(cell: S2Cell): boolean;
31
- }
package/dist/S2Region.js DELETED
@@ -1,17 +0,0 @@
1
- /*
2
- * Copyright 2005 Google Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- "use strict";
17
- //# sourceMappingURL=S2Region.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"S2Region.js","sourceRoot":"","sources":["../src/S2Region.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}