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.
- package/LICENSE +21 -0
- package/README.md +102 -15
- package/dist/export.cjs +5350 -0
- package/dist/export.cjs.map +1 -0
- package/dist/export.d.cts +1847 -0
- package/dist/export.d.ts +1837 -20
- package/dist/export.js +5299 -62
- package/dist/export.js.map +1 -1
- package/package.json +34 -55
- package/.eslintignore +0 -3
- package/.eslintrc.cjs +0 -11
- package/.github/workflows/lint.js.yml +0 -22
- package/.github/workflows/node.js.yml +0 -22
- package/.mocharc.js +0 -7
- package/dist/Interval.d.ts +0 -24
- package/dist/Interval.js +0 -23
- package/dist/Interval.js.map +0 -1
- package/dist/MutableInteger.d.ts +0 -4
- package/dist/MutableInteger.js +0 -10
- package/dist/MutableInteger.js.map +0 -1
- package/dist/Platform.d.ts +0 -15
- package/dist/Platform.js +0 -53
- package/dist/Platform.js.map +0 -1
- package/dist/R1Interval.d.ts +0 -76
- package/dist/R1Interval.js +0 -158
- package/dist/R1Interval.js.map +0 -1
- package/dist/R2Vector.d.ts +0 -34
- package/dist/R2Vector.js +0 -131
- package/dist/R2Vector.js.map +0 -1
- package/dist/S1Angle.d.ts +0 -60
- package/dist/S1Angle.js +0 -133
- package/dist/S1Angle.js.map +0 -1
- package/dist/S1ChordAngle.d.ts +0 -166
- package/dist/S1ChordAngle.js +0 -318
- package/dist/S1ChordAngle.js.map +0 -1
- package/dist/S1Interval.d.ts +0 -109
- package/dist/S1Interval.js +0 -398
- package/dist/S1Interval.js.map +0 -1
- package/dist/S2.d.ts +0 -96
- package/dist/S2.js +0 -231
- package/dist/S2.js.map +0 -1
- package/dist/S2Cap.d.ts +0 -122
- package/dist/S2Cap.js +0 -399
- package/dist/S2Cap.js.map +0 -1
- package/dist/S2Cell.d.ts +0 -106
- package/dist/S2Cell.js +0 -358
- package/dist/S2Cell.js.map +0 -1
- package/dist/S2CellId.d.ts +0 -290
- package/dist/S2CellId.js +0 -983
- package/dist/S2CellId.js.map +0 -1
- package/dist/S2CellUnion.d.ts +0 -179
- package/dist/S2CellUnion.js +0 -523
- package/dist/S2CellUnion.js.map +0 -1
- package/dist/S2EdgeUtil.d.ts +0 -17
- package/dist/S2EdgeUtil.js +0 -785
- package/dist/S2EdgeUtil.js.map +0 -1
- package/dist/S2LatLng.d.ts +0 -77
- package/dist/S2LatLng.js +0 -186
- package/dist/S2LatLng.js.map +0 -1
- package/dist/S2LatLngRect.d.ts +0 -190
- package/dist/S2LatLngRect.js +0 -624
- package/dist/S2LatLngRect.js.map +0 -1
- package/dist/S2Metric.d.ts +0 -38
- package/dist/S2Metric.js +0 -79
- package/dist/S2Metric.js.map +0 -1
- package/dist/S2Point.d.ts +0 -78
- package/dist/S2Point.js +0 -250
- package/dist/S2Point.js.map +0 -1
- package/dist/S2Projections.d.ts +0 -102
- package/dist/S2Projections.js +0 -331
- package/dist/S2Projections.js.map +0 -1
- package/dist/S2Region.d.ts +0 -31
- package/dist/S2Region.js +0 -18
- package/dist/S2Region.js.map +0 -1
- package/dist/S2RegionCoverer.d.ts +0 -186
- package/dist/S2RegionCoverer.js +0 -471
- package/dist/S2RegionCoverer.js.map +0 -1
- package/dist/utils/preconditions.d.ts +0 -2
- package/dist/utils/preconditions.js +0 -16
- package/dist/utils/preconditions.js.map +0 -1
package/dist/S2LatLngRect.js
DELETED
|
@@ -1,624 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.S2LatLngRect = void 0;
|
|
4
|
-
const S1Interval_1 = require("./S1Interval");
|
|
5
|
-
const R1Interval_1 = require("./R1Interval");
|
|
6
|
-
const S2LatLng_1 = require("./S2LatLng");
|
|
7
|
-
const S2_1 = require("./S2");
|
|
8
|
-
const S2Point_1 = require("./S2Point");
|
|
9
|
-
const S1Angle_1 = require("./S1Angle");
|
|
10
|
-
const S2EdgeUtil_1 = require("./S2EdgeUtil");
|
|
11
|
-
const S2Cap_1 = require("./S2Cap");
|
|
12
|
-
const Platform_1 = require("./Platform");
|
|
13
|
-
class S2LatLngRect {
|
|
14
|
-
constructor(lat, lng) {
|
|
15
|
-
this.lat = lat;
|
|
16
|
-
this.lng = lng;
|
|
17
|
-
}
|
|
18
|
-
static fromLatLng(lo, hi) {
|
|
19
|
-
return new S2LatLngRect(new R1Interval_1.R1Interval(lo.latRadians, hi.latRadians), new S1Interval_1.S1Interval(lo.lngRadians, hi.lngRadians));
|
|
20
|
-
}
|
|
21
|
-
/** The canonical empty rectangle */
|
|
22
|
-
static empty() {
|
|
23
|
-
return new S2LatLngRect(R1Interval_1.R1Interval.empty(), S1Interval_1.S1Interval.empty());
|
|
24
|
-
}
|
|
25
|
-
/** The canonical full rectangle. */
|
|
26
|
-
static full() {
|
|
27
|
-
return new S2LatLngRect(S2LatLngRect.fullLat(), S1Interval_1.S1Interval.full());
|
|
28
|
-
}
|
|
29
|
-
/** The full allowable range of latitudes. */
|
|
30
|
-
static fullLat() {
|
|
31
|
-
return new R1Interval_1.R1Interval(-S2_1.S2.M_PI_2, S2_1.S2.M_PI_2);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Construct a rectangle from a center point (in lat-lng space) and size in
|
|
35
|
-
* each dimension. If size.lng is greater than 360 degrees it is clamped,
|
|
36
|
-
* and latitudes greater than +/- 90 degrees are also clamped. So for example,
|
|
37
|
-
* FromCenterSize((80,170),(20,20)) -> (lo=(60,150),hi=(90,-170)).
|
|
38
|
-
*/
|
|
39
|
-
static fromCenterSize(center, size) {
|
|
40
|
-
return S2LatLngRect.fromPoint(center).expanded(size.mul(0.5));
|
|
41
|
-
}
|
|
42
|
-
/** Convenience method to construct a rectangle containing a single point. */
|
|
43
|
-
static fromPoint(p) {
|
|
44
|
-
// assert (p.isValid());
|
|
45
|
-
return S2LatLngRect.fromLatLng(p, p);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Convenience method to construct the minimal bounding rectangle containing
|
|
49
|
-
* the two given points. This is equivalent to starting with an empty
|
|
50
|
-
* rectangle and calling AddPoint() twice. Note that it is different than the
|
|
51
|
-
* S2LatLngRect(lo, hi) constructor, where the first point is always used as
|
|
52
|
-
* the lower-left corner of the resulting rectangle.
|
|
53
|
-
*/
|
|
54
|
-
static fromPointPair(p1, p2) {
|
|
55
|
-
// assert (p1.isValid() && p2.isValid());
|
|
56
|
-
return new S2LatLngRect(R1Interval_1.R1Interval.fromPointPair(p1.latRadians, p2
|
|
57
|
-
.latRadians), S1Interval_1.S1Interval.fromPointPair(p1.lngRadians, p2.lngRadians));
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Return a latitude-longitude rectangle that contains the edge from "a" to
|
|
61
|
-
* "b". Both points must be unit-length. Note that the bounding rectangle of
|
|
62
|
-
* an edge can be larger than the bounding rectangle of its endpoints.
|
|
63
|
-
*/
|
|
64
|
-
static fromEdge(a, b) {
|
|
65
|
-
// assert (S2.isUnitLength(a) && S2.isUnitLength(b));
|
|
66
|
-
const r = S2LatLngRect.fromPointPair(S2LatLng_1.S2LatLng.fromPoint(a), S2LatLng_1.S2LatLng.fromPoint(b));
|
|
67
|
-
// Check whether the min/max latitude occurs in the edge interior.
|
|
68
|
-
// We find the normal to the plane containing AB, and then a vector "dir" in
|
|
69
|
-
// this plane that also passes through the equator. We use RobustCrossProd
|
|
70
|
-
// to ensure that the edge normal is accurate even when the two points are
|
|
71
|
-
// very close together.
|
|
72
|
-
const ab = S2_1.S2.robustCrossProd(a, b);
|
|
73
|
-
const dir = S2Point_1.S2Point.crossProd(ab, new S2Point_1.S2Point(0, 0, 1));
|
|
74
|
-
const da = dir.dotProd(a);
|
|
75
|
-
const db = dir.dotProd(b);
|
|
76
|
-
if (da * db >= 0) {
|
|
77
|
-
// Minimum and maximum latitude are attained at the vertices.
|
|
78
|
-
return r;
|
|
79
|
-
}
|
|
80
|
-
// Minimum/maximum latitude occurs in the edge interior. This affects the
|
|
81
|
-
// latitude bounds but not the longitude bounds.
|
|
82
|
-
const absLat = Math.acos(ab.z / Math.abs(ab.norm()));
|
|
83
|
-
if (da < 0) {
|
|
84
|
-
return new S2LatLngRect(new R1Interval_1.R1Interval(r.lat.lo, absLat), r.lng);
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
return new S2LatLngRect(new R1Interval_1.R1Interval(-absLat, r.lat.hi), r.lng);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Return true if the rectangle is valid, which essentially just means that
|
|
92
|
-
* the latitude bounds do not exceed Pi/2 in absolute value and the longitude
|
|
93
|
-
* bounds do not exceed Pi in absolute value.
|
|
94
|
-
*
|
|
95
|
-
*/
|
|
96
|
-
isValid() {
|
|
97
|
-
// The lat/lng ranges must either be both empty or both non-empty.
|
|
98
|
-
return (Math.abs(this.lat.lo) <= S2_1.S2.M_PI_2 && Math.abs(this.lat.hi) <= (S2_1.S2.M_PI_2)
|
|
99
|
-
&& this.lng.isValid() && this.lat.isEmpty() == this.lng.isEmpty());
|
|
100
|
-
}
|
|
101
|
-
lo() {
|
|
102
|
-
return new S2LatLng_1.S2LatLng(this.lat.lo, this.lng.lo);
|
|
103
|
-
}
|
|
104
|
-
hi() {
|
|
105
|
-
return new S2LatLng_1.S2LatLng(this.lat.hi, this.lng.hi);
|
|
106
|
-
}
|
|
107
|
-
latLo() {
|
|
108
|
-
return S1Angle_1.S1Angle.radians(this.lat.lo);
|
|
109
|
-
}
|
|
110
|
-
latHi() {
|
|
111
|
-
return S1Angle_1.S1Angle.radians(this.lat.hi);
|
|
112
|
-
}
|
|
113
|
-
lngLo() {
|
|
114
|
-
return S1Angle_1.S1Angle.radians(this.lng.lo);
|
|
115
|
-
}
|
|
116
|
-
lngHi() {
|
|
117
|
-
return S1Angle_1.S1Angle.radians(this.lng.hi);
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Return true if the rectangle is empty, i.e. it contains no points at all.
|
|
121
|
-
*/
|
|
122
|
-
isEmpty() {
|
|
123
|
-
return this.lat.isEmpty();
|
|
124
|
-
}
|
|
125
|
-
// Return true if the rectangle is full, i.e. it contains all points.
|
|
126
|
-
isFull() {
|
|
127
|
-
// console.log(this.lat.toString());
|
|
128
|
-
// console.log(S2LatLngRect.fullLat().toString());
|
|
129
|
-
return this.lat.equals(S2LatLngRect.fullLat()) && this.lng.isFull();
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Return true if lng_.lo() > lng_.hi(), i.e. the rectangle crosses the 180
|
|
133
|
-
* degree latitude line.
|
|
134
|
-
*/
|
|
135
|
-
isInverted() {
|
|
136
|
-
return this.lng.isInverted();
|
|
137
|
-
}
|
|
138
|
-
/** Return the k-th vertex of the rectangle (k = 0,1,2,3) in CCW order. */
|
|
139
|
-
getVertex(k) {
|
|
140
|
-
// Return the points in CCW order (SW, SE, NE, NW).
|
|
141
|
-
switch (k) {
|
|
142
|
-
case 0:
|
|
143
|
-
return this.lo();
|
|
144
|
-
case 1:
|
|
145
|
-
return new S2LatLng_1.S2LatLng(this.lat.lo, this.lng.hi);
|
|
146
|
-
case 2:
|
|
147
|
-
return this.hi();
|
|
148
|
-
case 3:
|
|
149
|
-
return new S2LatLng_1.S2LatLng(this.lat.hi, this.lng.lo);
|
|
150
|
-
default:
|
|
151
|
-
throw new Error("Invalid vertex index.");
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Return the center of the rectangle in latitude-longitude space (in general
|
|
156
|
-
* this is not the center of the region on the sphere).
|
|
157
|
-
*/
|
|
158
|
-
getCenter() {
|
|
159
|
-
return new S2LatLng_1.S2LatLng(this.lat.getCenter(), this.lng.getCenter());
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Return the minimum distance (measured along the surface of the sphere)
|
|
163
|
-
* from a given point to the rectangle (both its boundary and its interior).
|
|
164
|
-
* The latLng must be valid.
|
|
165
|
-
*/
|
|
166
|
-
getDistanceLL(p) {
|
|
167
|
-
// The algorithm here is the same as in getDistance(S2LagLngRect), only
|
|
168
|
-
// with simplified calculations.
|
|
169
|
-
if (this.isEmpty()) {
|
|
170
|
-
throw new Error();
|
|
171
|
-
}
|
|
172
|
-
if (!p.isValid()) {
|
|
173
|
-
throw new Error('point is not valid');
|
|
174
|
-
}
|
|
175
|
-
if (this.lng.contains(p.lngRadians)) {
|
|
176
|
-
return new S1Angle_1.S1Angle(Math.max(0.0, Math.max(p.latRadians - this.lat.hi, this.lat.lo - p.latRadians)));
|
|
177
|
-
}
|
|
178
|
-
const interval = new S1Interval_1.S1Interval(this.lng.hi, this.lng.complement().getCenter());
|
|
179
|
-
let aLng = this.lng.lo;
|
|
180
|
-
if (interval.contains(p.lngRadians)) {
|
|
181
|
-
aLng = this.lng.hi;
|
|
182
|
-
}
|
|
183
|
-
const lo = new S2LatLng_1.S2LatLng(this.lat.lo, aLng).toPoint();
|
|
184
|
-
const hi = new S2LatLng_1.S2LatLng(this.lat.hi, aLng).toPoint();
|
|
185
|
-
const loCrossHi = new S2LatLng_1.S2LatLng(0, aLng - S2_1.S2.M_PI_2).normalized().toPoint();
|
|
186
|
-
return S2EdgeUtil_1.S2EdgeUtil.getDistance(p.toPoint(), lo, hi, loCrossHi);
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Return the minimum distance (measured along the surface of the sphere) to
|
|
190
|
-
* the given S2LatLngRect. Both S2LatLngRects must be non-empty.
|
|
191
|
-
*/
|
|
192
|
-
getDistanceLLR(other) {
|
|
193
|
-
const b = other;
|
|
194
|
-
if (this.isEmpty()) {
|
|
195
|
-
throw new Error();
|
|
196
|
-
}
|
|
197
|
-
if (b.isEmpty()) {
|
|
198
|
-
throw new Error();
|
|
199
|
-
}
|
|
200
|
-
// First, handle the trivial cases where the longitude intervals overlap.
|
|
201
|
-
if (this.lng.intersects(b.lng)) {
|
|
202
|
-
if (this.lat.intersects(b.lat)) {
|
|
203
|
-
return new S1Angle_1.S1Angle(0); // Intersection between a and b.
|
|
204
|
-
}
|
|
205
|
-
// We found an overlap in the longitude interval, but not in the latitude
|
|
206
|
-
// interval. This means the shortest path travels along some line of
|
|
207
|
-
// longitude connecting the high-latitude of the lower rect with the
|
|
208
|
-
// low-latitude of the higher rect.
|
|
209
|
-
let lo, hi;
|
|
210
|
-
if (this.lat.lo > b.lat.hi) {
|
|
211
|
-
lo = b.lat.hi;
|
|
212
|
-
hi = this.lat.lo;
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
lo = this.lat.hi;
|
|
216
|
-
hi = b.lat.lo;
|
|
217
|
-
}
|
|
218
|
-
return S1Angle_1.S1Angle.radians(hi.radians() - lo.radians());
|
|
219
|
-
}
|
|
220
|
-
// The longitude intervals don't overlap. In this case, the closest points
|
|
221
|
-
// occur somewhere on the pair of longitudinal edges which are nearest in
|
|
222
|
-
// longitude-space.
|
|
223
|
-
let aLng, bLng;
|
|
224
|
-
const loHi = S1Interval_1.S1Interval.fromPointPair(this.lng.lo, b.lng.hi);
|
|
225
|
-
const hiLo = S1Interval_1.S1Interval.fromPointPair(this.lng.hi, b.lng.lo);
|
|
226
|
-
if (loHi.getLength() < (hiLo.getLength())) {
|
|
227
|
-
aLng = this.lng.lo;
|
|
228
|
-
bLng = b.lng.hi;
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
aLng = this.lng.hi;
|
|
232
|
-
bLng = b.lng.lo;
|
|
233
|
-
}
|
|
234
|
-
// The shortest distance between the two longitudinal segments will include
|
|
235
|
-
// at least one segment endpoint. We could probably narrow this down further
|
|
236
|
-
// to a single point-edge distance by comparing the relative latitudes of the
|
|
237
|
-
// endpoints, but for the sake of clarity, we'll do all four point-edge
|
|
238
|
-
// distance tests.
|
|
239
|
-
const aLo = new S2LatLng_1.S2LatLng(this.lat.lo, aLng).toPoint();
|
|
240
|
-
const aHi = new S2LatLng_1.S2LatLng(this.lat.hi, aLng).toPoint();
|
|
241
|
-
const aLoCrossHi = new S2LatLng_1.S2LatLng(0, aLng.radians().minus(S2_1.S2.M_PI_2)).normalized().toPoint();
|
|
242
|
-
const bLo = new S2LatLng_1.S2LatLng(b.lat.lo, bLng).toPoint();
|
|
243
|
-
const bHi = new S2LatLng_1.S2LatLng(b.lat.hi, bLng).toPoint();
|
|
244
|
-
const bLoCrossHi = new S2LatLng_1.S2LatLng(0, bLng.radians().minus(S2_1.S2.M_PI_2)).normalized().toPoint();
|
|
245
|
-
return S1Angle_1.S1Angle.min(S2EdgeUtil_1.S2EdgeUtil.getDistance(aLo, bLo, bHi, bLoCrossHi), S1Angle_1.S1Angle.min(S2EdgeUtil_1.S2EdgeUtil.getDistance(aHi, bLo, bHi, bLoCrossHi), S1Angle_1.S1Angle.min(S2EdgeUtil_1.S2EdgeUtil.getDistance(bLo, aLo, aHi, aLoCrossHi), S2EdgeUtil_1.S2EdgeUtil.getDistance(bHi, aLo, aHi, aLoCrossHi))));
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Return the width and height of this rectangle in latitude-longitude space.
|
|
249
|
-
* Empty rectangles have a negative width and height.
|
|
250
|
-
*/
|
|
251
|
-
getSize() {
|
|
252
|
-
return new S2LatLng_1.S2LatLng(this.lat.getLength(), this.lng.getLength());
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* More efficient version of Contains() that accepts a S2LatLng rather than an
|
|
256
|
-
* S2Point.
|
|
257
|
-
*/
|
|
258
|
-
containsLL(ll) {
|
|
259
|
-
// assert (ll.isValid());
|
|
260
|
-
return (this.lat.contains(ll.latRadians) && this.lng.contains(ll.lngRadians));
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Return true if and only if the given point is contained in the interior of
|
|
264
|
-
* the region (i.e. the region excluding its boundary). The point 'p' does not
|
|
265
|
-
* need to be normalized.
|
|
266
|
-
*/
|
|
267
|
-
interiorContainsP(p) {
|
|
268
|
-
return this.interiorContainsLL(S2LatLng_1.S2LatLng.fromPoint(p));
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* More efficient version of InteriorContains() that accepts a S2LatLng rather
|
|
272
|
-
* than an S2Point.
|
|
273
|
-
*/
|
|
274
|
-
interiorContainsLL(ll) {
|
|
275
|
-
// assert (ll.isValid());
|
|
276
|
-
return (this.lat.interiorContains(ll.latRadians) && this.lng
|
|
277
|
-
.interiorContains(ll.lngRadians));
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Return true if and only if the rectangle contains the given other
|
|
281
|
-
* rectangle.
|
|
282
|
-
*/
|
|
283
|
-
containsLLR(other) {
|
|
284
|
-
return this.lat.containsI(other.lat) && this.lng.containsI(other.lng);
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Return true if and only if the interior of this rectangle contains all
|
|
288
|
-
* points of the given other rectangle (including its boundary).
|
|
289
|
-
*/
|
|
290
|
-
interiorContainsLLR(other) {
|
|
291
|
-
return (this.lat.interiorContainsI(other.lat) && this.lng
|
|
292
|
-
.interiorContainsI(other.lng));
|
|
293
|
-
}
|
|
294
|
-
/** Return true if this rectangle and the given other rectangle have any
|
|
295
|
-
points in common. */
|
|
296
|
-
intersectsLLR(other) {
|
|
297
|
-
return this.lat.intersects(other.lat) && this.lng.intersects(other.lng);
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* Returns true if this rectangle intersects the given cell. (This is an exact
|
|
301
|
-
* test and may be fairly expensive, see also MayIntersect below.)
|
|
302
|
-
*/
|
|
303
|
-
intersects(cell) {
|
|
304
|
-
// First we eliminate the cases where one region completely contains the
|
|
305
|
-
// other. Once these are disposed of, then the regions will intersect
|
|
306
|
-
// if and only if their boundaries intersect.
|
|
307
|
-
if (this.isEmpty()) {
|
|
308
|
-
return false;
|
|
309
|
-
}
|
|
310
|
-
if (this.containsP(cell.getCenterRaw())) {
|
|
311
|
-
return true;
|
|
312
|
-
}
|
|
313
|
-
if (cell.contains(this.getCenter().toPoint())) {
|
|
314
|
-
return true;
|
|
315
|
-
}
|
|
316
|
-
// Quick rejection test (not required for correctness).
|
|
317
|
-
if (!this.intersectsLLR(cell.getRectBound())) {
|
|
318
|
-
return false;
|
|
319
|
-
}
|
|
320
|
-
// Now check whether the boundaries intersect. Unfortunately, a
|
|
321
|
-
// latitude-longitude rectangle does not have straight edges -- two edges
|
|
322
|
-
// are curved, and at least one of them is concave.
|
|
323
|
-
// Precompute the cell vertices as points and latitude-longitudes.
|
|
324
|
-
const cellV = new Array(4);
|
|
325
|
-
const cellLl = new Array(4);
|
|
326
|
-
for (let i = 0; i < 4; ++i) {
|
|
327
|
-
cellV[i] = cell.getVertex(i); // Must be normalized.
|
|
328
|
-
cellLl[i] = S2LatLng_1.S2LatLng.fromPoint(cellV[i]);
|
|
329
|
-
if (this.containsLL(cellLl[i])) {
|
|
330
|
-
return true; // Quick acceptance test.
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
for (let i = 0; i < 4; ++i) {
|
|
334
|
-
const edgeLng = S1Interval_1.S1Interval.fromPointPair(cellLl[i].lngRadians, cellLl[(i + 1) & 3].lngRadians);
|
|
335
|
-
if (!this.lng.intersects(edgeLng)) {
|
|
336
|
-
continue;
|
|
337
|
-
}
|
|
338
|
-
const a = cellV[i];
|
|
339
|
-
const b = cellV[(i + 1) & 3];
|
|
340
|
-
if (edgeLng.contains(this.lng.lo)) {
|
|
341
|
-
if (S2LatLngRect.intersectsLngEdge(a, b, this.lat, this.lng.lo)) {
|
|
342
|
-
return true;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
if (edgeLng.contains(this.lng.hi)) {
|
|
346
|
-
if (S2LatLngRect.intersectsLngEdge(a, b, this.lat, this.lng.hi)) {
|
|
347
|
-
return true;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
if (S2LatLngRect.intersectsLatEdge(a, b, this.lat.lo, this.lng)) {
|
|
351
|
-
return true;
|
|
352
|
-
}
|
|
353
|
-
if (S2LatLngRect.intersectsLatEdge(a, b, this.lat.hi, this.lng)) {
|
|
354
|
-
return true;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
return false;
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Return true if and only if the interior of this rectangle intersects any
|
|
361
|
-
* point (including the boundary) of the given other rectangle.
|
|
362
|
-
*/
|
|
363
|
-
interiorIntersects(other) {
|
|
364
|
-
return (this.lat.interiorIntersects(other.lat) && this.lng
|
|
365
|
-
.interiorIntersects(other.lng));
|
|
366
|
-
}
|
|
367
|
-
addPoint(p) {
|
|
368
|
-
return this.addPointLL(S2LatLng_1.S2LatLng.fromPoint(p));
|
|
369
|
-
}
|
|
370
|
-
// Increase the size of the bounding rectangle to include the given point.
|
|
371
|
-
// The rectangle is expanded by the minimum amount possible.
|
|
372
|
-
addPointLL(ll) {
|
|
373
|
-
const newLat = this.lat.addPoint(ll.latRadians);
|
|
374
|
-
const newLng = this.lng.addPoint(ll.lngRadians);
|
|
375
|
-
return new S2LatLngRect(newLat, newLng);
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* Return a rectangle that contains all points whose latitude distance from
|
|
379
|
-
* this rectangle is at most margin.lat, and whose longitude distance from
|
|
380
|
-
* this rectangle is at most margin.lng. In particular, latitudes are
|
|
381
|
-
* clamped while longitudes are wrapped. Note that any expansion of an empty
|
|
382
|
-
* interval remains empty, and both components of the given margin must be
|
|
383
|
-
* non-negative.
|
|
384
|
-
*
|
|
385
|
-
* NOTE: If you are trying to grow a rectangle by a certain *distance* on the
|
|
386
|
-
* sphere (e.g. 5km), use the ConvolveWithCap() method instead.
|
|
387
|
-
*/
|
|
388
|
-
expanded(margin) {
|
|
389
|
-
// assert (margin.latRadians >= 0 && margin.lngRadians >= 0);
|
|
390
|
-
if (this.isEmpty()) {
|
|
391
|
-
return this;
|
|
392
|
-
}
|
|
393
|
-
return new S2LatLngRect(this.lat
|
|
394
|
-
.expanded(margin.latRadians)
|
|
395
|
-
.intersection(S2LatLngRect.fullLat()), this.lng.expanded(margin.lngRadians));
|
|
396
|
-
}
|
|
397
|
-
polarClosure() {
|
|
398
|
-
if (this.lat.lo == -S2_1.S2.M_PI_2 || this.lat.hi == S2_1.S2.M_PI_2) {
|
|
399
|
-
return new S2LatLngRect(this.lat, S1Interval_1.S1Interval.full());
|
|
400
|
-
}
|
|
401
|
-
else {
|
|
402
|
-
return this;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
/**
|
|
406
|
-
* Return the smallest rectangle containing the union of this rectangle and
|
|
407
|
-
* the given rectangle.
|
|
408
|
-
*/
|
|
409
|
-
union(other) {
|
|
410
|
-
return new S2LatLngRect(this.lat.union(other.lat), this.lng.union(other.lng));
|
|
411
|
-
}
|
|
412
|
-
/**
|
|
413
|
-
* Return the smallest rectangle containing the intersection of this rectangle
|
|
414
|
-
* and the given rectangle. Note that the region of intersection may consist
|
|
415
|
-
* of two disjoint rectangles, in which case a single rectangle spanning both
|
|
416
|
-
* of them is returned.
|
|
417
|
-
*/
|
|
418
|
-
intersection(other) {
|
|
419
|
-
const intersectLat = this.lat.intersection(other.lat);
|
|
420
|
-
const intersectLng = this.lng.intersection(other.lng);
|
|
421
|
-
if (intersectLat.isEmpty() || intersectLng.isEmpty()) {
|
|
422
|
-
// The lat/lng ranges must either be both empty or both non-empty.
|
|
423
|
-
return S2LatLngRect.empty();
|
|
424
|
-
}
|
|
425
|
-
return new S2LatLngRect(intersectLat, intersectLng);
|
|
426
|
-
}
|
|
427
|
-
//
|
|
428
|
-
// /**
|
|
429
|
-
// * Return a rectangle that contains the convolution of this rectangle with a
|
|
430
|
-
// * cap of the given angle. This expands the rectangle by a fixed distance (as
|
|
431
|
-
// * opposed to growing the rectangle in latitude-longitude space). The returned
|
|
432
|
-
// * rectangle includes all points whose minimum distance to the original
|
|
433
|
-
// * rectangle is at most the given angle.
|
|
434
|
-
// */
|
|
435
|
-
// public S2LatLngRect convolveWithCap(/*S1Angle*/ angle) {
|
|
436
|
-
// // The most straightforward approach is to build a cap centered on each
|
|
437
|
-
// // vertex and take the union of all the bounding rectangles (including the
|
|
438
|
-
// // original rectangle; this is necessary for very large rectangles).
|
|
439
|
-
//
|
|
440
|
-
// // Optimization: convert the angle to a height exactly once.
|
|
441
|
-
// S2Cap cap = S2Cap.fromAxisAngle(new S2Point(1, 0, 0), angle);
|
|
442
|
-
//
|
|
443
|
-
// S2LatLngRect r = this;
|
|
444
|
-
// for (int k = 0; k < 4; ++k) {
|
|
445
|
-
// S2Cap vertexCap = S2Cap.fromAxisHeight(getVertex(k).toPoint(), cap
|
|
446
|
-
// .height());
|
|
447
|
-
// r = r.union(vertexCap.getRectBound());
|
|
448
|
-
// }
|
|
449
|
-
// return r;
|
|
450
|
-
// }
|
|
451
|
-
/** Return the surface area of this rectangle on the unit sphere. */
|
|
452
|
-
area() {
|
|
453
|
-
if (this.isEmpty()) {
|
|
454
|
-
return 0;
|
|
455
|
-
}
|
|
456
|
-
// This is the size difference of the two spherical caps, multiplied by
|
|
457
|
-
// the longitude ratio.
|
|
458
|
-
//TODO: check if this.lat.hi & this.lat.lo is radians.
|
|
459
|
-
return this.lng.getLength() * (Math.sin(this.lat.hi) - Math.abs(Math.sin(this.lat.lo)));
|
|
460
|
-
}
|
|
461
|
-
/** Return true if two rectangles contains the same set of points. */
|
|
462
|
-
equals(that) {
|
|
463
|
-
if (!(that instanceof S2LatLngRect)) {
|
|
464
|
-
return false;
|
|
465
|
-
}
|
|
466
|
-
return this.lat.equals(that.lat) && this.lng.equals(that.lng);
|
|
467
|
-
}
|
|
468
|
-
/**
|
|
469
|
-
* Return true if the latitude and longitude intervals of the two rectangles
|
|
470
|
-
* are the same up to the given tolerance (see r1interval.h and s1interval.h
|
|
471
|
-
* for details).
|
|
472
|
-
*/
|
|
473
|
-
approxEquals(other, maxError = 1e-15) {
|
|
474
|
-
return (this.lat.approxEquals(other.lat, maxError) && this.lng.approxEquals(other.lng, maxError));
|
|
475
|
-
}
|
|
476
|
-
// //////////////////////////////////////////////////////////////////////
|
|
477
|
-
// S2Region interface (see {@code S2Region} for details):
|
|
478
|
-
clone() {
|
|
479
|
-
return new S2LatLngRect(this.lat, this.lng);
|
|
480
|
-
}
|
|
481
|
-
getCapBound() {
|
|
482
|
-
// We consider two possible bounding caps, one whose axis passes through the center of the
|
|
483
|
-
// lat-lng rectangle and one whose axis is the north or south pole. We return the smaller of the
|
|
484
|
-
// two caps.
|
|
485
|
-
if (this.isEmpty()) {
|
|
486
|
-
return S2Cap_1.S2Cap.empty();
|
|
487
|
-
}
|
|
488
|
-
let poleZ = 0;
|
|
489
|
-
let poleAngle = 0;
|
|
490
|
-
if (this.lat.lo + this.lat.hi < 0) {
|
|
491
|
-
// South pole axis yields smaller cap.
|
|
492
|
-
poleZ = -1;
|
|
493
|
-
poleAngle = S2_1.S2.M_PI_2 + this.lat.hi;
|
|
494
|
-
}
|
|
495
|
-
else {
|
|
496
|
-
poleZ = 1;
|
|
497
|
-
poleAngle = S2_1.S2.M_PI_2 - this.lat.lo;
|
|
498
|
-
}
|
|
499
|
-
const poleCap = S2Cap_1.S2Cap.fromAxisAngle(new S2Point_1.S2Point(0, 0, poleZ), S1Angle_1.S1Angle.radians(poleAngle));
|
|
500
|
-
// For bounding rectangles that span 180 degrees or less in longitude, the maximum cap size is
|
|
501
|
-
// achieved at one of the rectangle vertices. For rectangles that are larger than 180 degrees,
|
|
502
|
-
// we punt and always return a bounding cap centered at one of the two poles.
|
|
503
|
-
const lngSpan = this.lng.hi - this.lng.lo;
|
|
504
|
-
if (Platform_1.Platform.IEEEremainder(lngSpan, 2 * S2_1.S2.M_PI) >= 0) {
|
|
505
|
-
if (lngSpan < 2 * S2_1.S2.M_PI) {
|
|
506
|
-
let midCap = S2Cap_1.S2Cap.fromAxisAngle(this.getCenter().toPoint(), S1Angle_1.S1Angle.radians(0));
|
|
507
|
-
for (let k = 0; k < 4; ++k) {
|
|
508
|
-
midCap = midCap.addPoint(this.getVertex(k).toPoint());
|
|
509
|
-
}
|
|
510
|
-
if (midCap.height() < poleCap.height()) {
|
|
511
|
-
return midCap;
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
return poleCap;
|
|
516
|
-
}
|
|
517
|
-
getRectBound() {
|
|
518
|
-
return this;
|
|
519
|
-
}
|
|
520
|
-
containsC(cell) {
|
|
521
|
-
// A latitude-longitude rectangle contains a cell if and only if it contains
|
|
522
|
-
// the cell's bounding rectangle. (This is an exact test.)
|
|
523
|
-
return this.containsLLR(cell.getRectBound());
|
|
524
|
-
}
|
|
525
|
-
/**
|
|
526
|
-
* This test is cheap but is NOT exact. Use Intersects() if you want a more
|
|
527
|
-
* accurate and more expensive test. Note that when this method is used by an
|
|
528
|
-
* S2RegionCoverer, the accuracy isn't all that important since if a cell may
|
|
529
|
-
* intersect the region then it is subdivided, and the accuracy of this method
|
|
530
|
-
* goes up as the cells get smaller.
|
|
531
|
-
*/
|
|
532
|
-
mayIntersectC(cell) {
|
|
533
|
-
// This test is cheap but is NOT exact (see s2latlngrect.h).
|
|
534
|
-
return this.intersectsLLR(cell.getRectBound());
|
|
535
|
-
}
|
|
536
|
-
/** The point 'p' does not need to be normalized. */
|
|
537
|
-
containsP(p) {
|
|
538
|
-
return this.containsLL(S2LatLng_1.S2LatLng.fromPoint(p));
|
|
539
|
-
}
|
|
540
|
-
/**
|
|
541
|
-
* Return true if the edge AB intersects the given edge of constant longitude.
|
|
542
|
-
*/
|
|
543
|
-
static /*boolean*/ intersectsLngEdge(a, b, lat, lng) {
|
|
544
|
-
// Return true if the segment AB intersects the given edge of constant
|
|
545
|
-
// longitude. The nice thing about edges of constant longitude is that
|
|
546
|
-
// they are straight lines on the sphere (geodesics).
|
|
547
|
-
return S2_1.S2.simpleCrossing(a, b, new S2LatLng_1.S2LatLng(lat.lo, lng)
|
|
548
|
-
.toPoint(), new S2LatLng_1.S2LatLng(lat.hi, lng).toPoint());
|
|
549
|
-
}
|
|
550
|
-
/**
|
|
551
|
-
* Return true if the edge AB intersects the given edge of constant latitude.
|
|
552
|
-
*/
|
|
553
|
-
static /*boolean*/ intersectsLatEdge(a, b, lat, lng) {
|
|
554
|
-
// Return true if the segment AB intersects the given edge of constant
|
|
555
|
-
// latitude. Unfortunately, lines of constant latitude are curves on
|
|
556
|
-
// the sphere. They can intersect a straight edge in 0, 1, or 2 points.
|
|
557
|
-
// assert (S2.isUnitLength(a) && S2.isUnitLength(b));
|
|
558
|
-
// First, compute the normal to the plane AB that points vaguely north.
|
|
559
|
-
let z = S2Point_1.S2Point.normalize(S2_1.S2.robustCrossProd(a, b));
|
|
560
|
-
if (z.z < (0)) {
|
|
561
|
-
z = S2Point_1.S2Point.neg(z);
|
|
562
|
-
}
|
|
563
|
-
// Extend this to an orthonormal frame (x,y,z) where x is the direction
|
|
564
|
-
// where the great circle through AB achieves its maximium latitude.
|
|
565
|
-
const y = S2Point_1.S2Point.normalize(S2_1.S2.robustCrossProd(z, new S2Point_1.S2Point(0, 0, 1)));
|
|
566
|
-
const x = S2Point_1.S2Point.crossProd(y, z);
|
|
567
|
-
// assert (S2.isUnitLength(x) && x.z >= 0);
|
|
568
|
-
// Compute the angle "theta" from the x-axis (in the x-y plane defined
|
|
569
|
-
// above) where the great circle intersects the given line of latitude.
|
|
570
|
-
const sinLat = Math.sin(lat);
|
|
571
|
-
if (Math.abs(sinLat) >= (x.z)) {
|
|
572
|
-
return false; // The great circle does not reach the given latitude.
|
|
573
|
-
}
|
|
574
|
-
// assert (x.z > 0);
|
|
575
|
-
const cosTheta = sinLat / x.z;
|
|
576
|
-
const sinTheta = Math.sqrt(1 - cosTheta * cosTheta);
|
|
577
|
-
const theta = Math.atan2(sinTheta, cosTheta);
|
|
578
|
-
// Math.atan2(sinTheta, cosTheta);
|
|
579
|
-
// The candidate intersection points are located +/- theta in the x-y
|
|
580
|
-
// plane. For an intersection to be valid, we need to check that the
|
|
581
|
-
// intersection point is contained in the interior of the edge AB and
|
|
582
|
-
// also that it is contained within the given longitude interval "lng".
|
|
583
|
-
// Compute the range of theta values spanned by the edge AB.
|
|
584
|
-
const abTheta = S1Interval_1.S1Interval.fromPointPair(Math.atan2(a.dotProd(y), a.dotProd(x)), Math.atan2(b.dotProd(y), b.dotProd(x)));
|
|
585
|
-
if (abTheta.contains(theta)) {
|
|
586
|
-
// Check if the intersection point is also in the given "lng" interval.
|
|
587
|
-
const isect = S2Point_1.S2Point.add(S2Point_1.S2Point.mul(x, cosTheta), S2Point_1.S2Point.mul(y, sinTheta));
|
|
588
|
-
if (lng.contains(Math.atan2(isect.y, isect.x))) {
|
|
589
|
-
return true;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
if (abTheta.contains(theta * -1)) {
|
|
593
|
-
// Check if the intersection point is also in the given "lng" interval.
|
|
594
|
-
const intersection = S2Point_1.S2Point.sub(S2Point_1.S2Point.mul(x, cosTheta), S2Point_1.S2Point.mul(y, sinTheta));
|
|
595
|
-
if (lng.contains(Math.atan2(intersection.y, intersection.x))) {
|
|
596
|
-
return true;
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
return false;
|
|
600
|
-
}
|
|
601
|
-
allVertex() {
|
|
602
|
-
return [
|
|
603
|
-
this.getVertex(0),
|
|
604
|
-
this.getVertex(1),
|
|
605
|
-
this.getVertex(2),
|
|
606
|
-
this.getVertex(3)
|
|
607
|
-
];
|
|
608
|
-
}
|
|
609
|
-
toGEOJSON() {
|
|
610
|
-
return {
|
|
611
|
-
type: 'Feature',
|
|
612
|
-
geometry: {
|
|
613
|
-
type: 'Polygon',
|
|
614
|
-
coordinates: [this.allVertex().concat(this.getVertex(0)).map(v => [parseFloat(v.lngDegrees.toFixed(5)), parseFloat(v.latDegrees.toFixed(5))])],
|
|
615
|
-
},
|
|
616
|
-
properties: {}
|
|
617
|
-
};
|
|
618
|
-
}
|
|
619
|
-
toString() {
|
|
620
|
-
return "[Lo=" + this.lo().toString() + ", Hi=" + this.hi().toString() + "]";
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
exports.S2LatLngRect = S2LatLngRect;
|
|
624
|
-
//# sourceMappingURL=S2LatLngRect.js.map
|
package/dist/S2LatLngRect.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"S2LatLngRect.js","sourceRoot":"","sources":["../src/S2LatLngRect.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AACxC,6CAAwC;AACxC,yCAAoC;AAEpC,6BAAwB;AACxB,uCAAkC;AAClC,uCAAkC;AAElC,6CAAwC;AACxC,mCAA8B;AAC9B,yCAAsC;AAEtC,MAAa,YAAY;IACvB,YAAmB,GAAc,EAAS,GAAc;QAArC,QAAG,GAAH,GAAG,CAAW;QAAS,QAAG,GAAH,GAAG,CAAW;IAExD,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,EAAW,EAAE,EAAW;QACxC,OAAO,IAAI,YAAY,CACnB,IAAI,uBAAU,CACV,EAAE,CAAC,UAAU,EACb,EAAE,CAAC,UAAU,CAChB,EACD,IAAI,uBAAU,CACV,EAAE,CAAC,UAAU,EACb,EAAE,CAAC,UAAU,CAChB,CACJ,CAAC;IACJ,CAAC;IAGD,oCAAoC;IAC7B,MAAM,CAAE,KAAK;QAClB,OAAO,IAAI,YAAY,CAAC,uBAAU,CAAC,KAAK,EAAE,EAAE,uBAAU,CAAC,KAAK,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,oCAAoC;IAC7B,MAAM,CAAE,IAAI;QACjB,OAAO,IAAI,YAAY,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,uBAAU,CAAC,IAAI,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,6CAA6C;IACtC,MAAM,CAAC,OAAO;QACnB,OAAO,IAAI,uBAAU,CAAC,CAAC,OAAE,CAAC,MAAM,EAAE,OAAE,CAAC,MAAM,CAAC,CAAC;IAC/C,CAAC;IAGD;;;;;OAKG;IACI,MAAM,CAAE,cAAc,CAAC,MAAe,EAAE,IAAa;QAC1D,OAAO,YAAY,CAAC,SAAS,CAAC,MA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