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.
- package/LICENSE +21 -0
- package/README.md +116 -13
- package/dist/export.cjs +5331 -0
- package/dist/export.cjs.map +1 -0
- package/dist/export.d.cts +1838 -0
- package/dist/export.d.ts +1828 -20
- package/dist/export.js +5279 -51
- package/dist/export.js.map +1 -1
- package/package.json +34 -49
- package/dist/Interval.d.ts +0 -24
- package/dist/Interval.js +0 -22
- package/dist/Interval.js.map +0 -1
- package/dist/MutableInteger.d.ts +0 -4
- package/dist/MutableInteger.js +0 -9
- package/dist/MutableInteger.js.map +0 -1
- package/dist/R1Interval.d.ts +0 -76
- package/dist/R1Interval.js +0 -167
- package/dist/R1Interval.js.map +0 -1
- package/dist/R2Vector.d.ts +0 -34
- package/dist/R2Vector.js +0 -138
- package/dist/R2Vector.js.map +0 -1
- package/dist/S1Angle.d.ts +0 -26
- package/dist/S1Angle.js +0 -78
- package/dist/S1Angle.js.map +0 -1
- package/dist/S1Interval.d.ts +0 -109
- package/dist/S1Interval.js +0 -403
- package/dist/S1Interval.js.map +0 -1
- package/dist/S2.d.ts +0 -91
- package/dist/S2.js +0 -236
- package/dist/S2.js.map +0 -1
- package/dist/S2Cap.d.ts +0 -113
- package/dist/S2Cap.js +0 -392
- package/dist/S2Cap.js.map +0 -1
- package/dist/S2Cell.d.ts +0 -103
- package/dist/S2Cell.js +0 -361
- package/dist/S2Cell.js.map +0 -1
- package/dist/S2CellId.d.ts +0 -267
- package/dist/S2CellId.js +0 -933
- package/dist/S2CellId.js.map +0 -1
- package/dist/S2CellUnion.d.ts +0 -180
- package/dist/S2CellUnion.js +0 -518
- package/dist/S2CellUnion.js.map +0 -1
- package/dist/S2EdgeUtil.d.ts +0 -17
- package/dist/S2EdgeUtil.js +0 -787
- package/dist/S2EdgeUtil.js.map +0 -1
- package/dist/S2LatLng.d.ts +0 -72
- package/dist/S2LatLng.js +0 -182
- package/dist/S2LatLng.js.map +0 -1
- package/dist/S2LatLngRect.d.ts +0 -185
- package/dist/S2LatLngRect.js +0 -605
- package/dist/S2LatLngRect.js.map +0 -1
- package/dist/S2Metric.d.ts +0 -38
- package/dist/S2Metric.js +0 -75
- package/dist/S2Metric.js.map +0 -1
- package/dist/S2Point.d.ts +0 -43
- package/dist/S2Point.js +0 -200
- package/dist/S2Point.js.map +0 -1
- package/dist/S2Projections.d.ts +0 -67
- package/dist/S2Projections.js +0 -152
- package/dist/S2Projections.js.map +0 -1
- package/dist/S2Region.d.ts +0 -31
- package/dist/S2Region.js +0 -17
- package/dist/S2Region.js.map +0 -1
- package/dist/S2RegionCoverer.d.ts +0 -171
- package/dist/S2RegionCoverer.js +0 -435
- package/dist/S2RegionCoverer.js.map +0 -1
- package/yarn.lock +0 -4381
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { S2Region } from "./S2Region";
|
|
2
|
-
import { S2CellId } from "./S2CellId";
|
|
3
|
-
import { S2CellUnion } from "./S2CellUnion";
|
|
4
|
-
/**
|
|
5
|
-
* An S2RegionCoverer is a class that allows arbitrary regions to be
|
|
6
|
-
* approximated as unions of cells (S2CellUnion). This is useful for
|
|
7
|
-
* implementing various sorts of search and precomputation operations.
|
|
8
|
-
*
|
|
9
|
-
* Typical usage: {@code S2RegionCoverer coverer; coverer.setMaxCells(5); S2Cap
|
|
10
|
-
* cap = S2Cap.fromAxisAngle(...); S2CellUnion covering;
|
|
11
|
-
* coverer.getCovering(cap, covering); * }
|
|
12
|
-
*
|
|
13
|
-
* This yields a cell union of at most 5 cells that is guaranteed to cover the
|
|
14
|
-
* given cap (a disc-shaped region on the sphere).
|
|
15
|
-
*
|
|
16
|
-
* The approximation algorithm is not optimal but does a pretty good job in
|
|
17
|
-
* practice. The output does not always use the maximum number of cells allowed,
|
|
18
|
-
* both because this would not always yield a better approximation, and because
|
|
19
|
-
* max_cells() is a limit on how much work is done exploring the possible
|
|
20
|
-
* covering as well as a limit on the final output size.
|
|
21
|
-
*
|
|
22
|
-
* One can also generate interior coverings, which are sets of cells which are
|
|
23
|
-
* entirely contained within a region. Interior coverings can be empty, even for
|
|
24
|
-
* non-empty regions, if there are no cells that satisfy the provided
|
|
25
|
-
* constraints and are contained by the region. Note that for performance
|
|
26
|
-
* reasons, it is wise to specify a max_level when computing interior coverings
|
|
27
|
-
* - otherwise for regions with small or zero area, the algorithm may spend a
|
|
28
|
-
* lot of time subdividing cells all the way to leaf level to try to find
|
|
29
|
-
* contained cells.
|
|
30
|
-
*
|
|
31
|
-
* This class is thread-unsafe. Simultaneous calls to any of the getCovering
|
|
32
|
-
* methods will conflict and produce unpredictable results.
|
|
33
|
-
*
|
|
34
|
-
*/
|
|
35
|
-
export declare class S2RegionCoverer {
|
|
36
|
-
/**
|
|
37
|
-
* By default, the covering uses at most 8 cells at any level. This gives a
|
|
38
|
-
* reasonable tradeoff between the number of cells used and the accuracy of
|
|
39
|
-
* the approximation (see table below).
|
|
40
|
-
*/
|
|
41
|
-
static DEFAULT_MAX_CELLS: number;
|
|
42
|
-
private static FACE_CELLS;
|
|
43
|
-
private minLevel;
|
|
44
|
-
private maxLevel;
|
|
45
|
-
private levelMod;
|
|
46
|
-
private maxCells;
|
|
47
|
-
private interiorCovering;
|
|
48
|
-
private candidatesCreatedCounter;
|
|
49
|
-
/**
|
|
50
|
-
* We save a temporary copy of the pointer passed to GetCovering() in order to
|
|
51
|
-
* avoid passing this parameter around internally. It is only used (and only
|
|
52
|
-
* valid) for the duration of a single GetCovering() call.
|
|
53
|
-
*/
|
|
54
|
-
protected region: S2Region;
|
|
55
|
-
/**
|
|
56
|
-
* A temporary variable used by GetCovering() that holds the cell ids that
|
|
57
|
-
* have been added to the covering so far.
|
|
58
|
-
*/
|
|
59
|
-
protected result: S2CellId[];
|
|
60
|
-
/**
|
|
61
|
-
* We keep the candidates in a priority queue. We specify a vector to hold the
|
|
62
|
-
* queue entries since for some reason priority_queue<> uses a deque by
|
|
63
|
-
* default.
|
|
64
|
-
*/
|
|
65
|
-
private candidateQueue;
|
|
66
|
-
/**
|
|
67
|
-
* Default constructor, sets all fields to default values.
|
|
68
|
-
*/
|
|
69
|
-
constructor();
|
|
70
|
-
/**
|
|
71
|
-
* Sets the minimum level to be used.
|
|
72
|
-
*/
|
|
73
|
-
setMinLevel(minLevel: number): S2RegionCoverer;
|
|
74
|
-
/**
|
|
75
|
-
* Sets the maximum level to be used.
|
|
76
|
-
*/
|
|
77
|
-
setMaxLevel(maxLevel: number): S2RegionCoverer;
|
|
78
|
-
/**
|
|
79
|
-
* If specified, then only cells where (level - min_level) is a multiple of
|
|
80
|
-
* "level_mod" will be used (default 1). This effectively allows the branching
|
|
81
|
-
* factor of the S2CellId hierarchy to be increased. Currently the only
|
|
82
|
-
* parameter values allowed are 1, 2, or 3, corresponding to branching factors
|
|
83
|
-
* of 4, 16, and 64 respectively.
|
|
84
|
-
*/
|
|
85
|
-
setLevelMod(levelMod: number): S2RegionCoverer;
|
|
86
|
-
/**
|
|
87
|
-
* Sets the maximum desired number of cells in the approximation (defaults to
|
|
88
|
-
* kDefaultMaxCells). Note the following:
|
|
89
|
-
*
|
|
90
|
-
* <ul>
|
|
91
|
-
* <li>For any setting of max_cells(), up to 6 cells may be returned if that
|
|
92
|
-
* is the minimum number of cells required (e.g. if the region intersects all
|
|
93
|
-
* six face cells). Up to 3 cells may be returned even for very tiny convex
|
|
94
|
-
* regions if they happen to be located at the intersection of three cube
|
|
95
|
-
* faces.
|
|
96
|
-
*
|
|
97
|
-
* <li>For any setting of max_cells(), an arbitrary number of cells may be
|
|
98
|
-
* returned if min_level() is too high for the region being approximated.
|
|
99
|
-
*
|
|
100
|
-
* <li>If max_cells() is less than 4, the area of the covering may be
|
|
101
|
-
* arbitrarily large compared to the area of the original region even if the
|
|
102
|
-
* region is convex (e.g. an S2Cap or S2LatLngRect).
|
|
103
|
-
* </ul>
|
|
104
|
-
*
|
|
105
|
-
* Accuracy is measured by dividing the area of the covering by the area of
|
|
106
|
-
* the original region. The following table shows the median and worst case
|
|
107
|
-
* values for this area ratio on a test case consisting of 100,000 spherical
|
|
108
|
-
* caps of random size (generated using s2regioncoverer_unittest):
|
|
109
|
-
*
|
|
110
|
-
* <pre>
|
|
111
|
-
* max_cells: 3 4 5 6 8 12 20 100 1000
|
|
112
|
-
* median ratio: 5.33 3.32 2.73 2.34 1.98 1.66 1.42 1.11 1.01
|
|
113
|
-
* worst case: 215518 14.41 9.72 5.26 3.91 2.75 1.92 1.20 1.02
|
|
114
|
-
* </pre>
|
|
115
|
-
*/
|
|
116
|
-
setMaxCells(maxCells: number): S2RegionCoverer;
|
|
117
|
-
/**
|
|
118
|
-
* Computes a list of cell ids that covers the given region and satisfies the
|
|
119
|
-
* various restrictions specified above.
|
|
120
|
-
*
|
|
121
|
-
* @param region The region to cover
|
|
122
|
-
* @param covering The list filled in by this method
|
|
123
|
-
*/
|
|
124
|
-
getCoveringCells(region: S2Region): S2CellId[];
|
|
125
|
-
/**
|
|
126
|
-
* Computes a list of cell ids that is contained within the given region and
|
|
127
|
-
* satisfies the various restrictions specified above.
|
|
128
|
-
*
|
|
129
|
-
* @param region The region to fill
|
|
130
|
-
* @param interior The list filled in by this method
|
|
131
|
-
*/
|
|
132
|
-
getInteriorCoveringCells(region: S2Region): S2CellId[];
|
|
133
|
-
/**
|
|
134
|
-
* Return a normalized cell union that covers the given region and satisfies
|
|
135
|
-
* the restrictions *EXCEPT* for min_level() and level_mod(). These criteria
|
|
136
|
-
* cannot be satisfied using a cell union because cell unions are
|
|
137
|
-
* automatically normalized by replacing four child cells with their parent
|
|
138
|
-
* whenever possible. (Note that the list of cell ids passed to the cell union
|
|
139
|
-
* constructor does in fact satisfy all the given restrictions.)
|
|
140
|
-
*/
|
|
141
|
-
getCoveringUnion(region: S2Region, covering?: S2CellUnion): S2CellUnion;
|
|
142
|
-
/**
|
|
143
|
-
* Return a normalized cell union that is contained within the given region
|
|
144
|
-
* and satisfies the restrictions *EXCEPT* for min_level() and level_mod().
|
|
145
|
-
*/
|
|
146
|
-
getInteriorCoveringUnion(region: S2Region, covering?: S2CellUnion): S2CellUnion;
|
|
147
|
-
/**
|
|
148
|
-
* If the cell intersects the given region, return a new candidate with no
|
|
149
|
-
* children, otherwise return null. Also marks the candidate as "terminal" if
|
|
150
|
-
* it should not be expanded further.
|
|
151
|
-
*/
|
|
152
|
-
private newCandidate(cell);
|
|
153
|
-
/** Return the log base 2 of the maximum number of children of a candidate. */
|
|
154
|
-
private maxChildrenShift();
|
|
155
|
-
/**
|
|
156
|
-
* Process a candidate by either adding it to the result list or expanding its
|
|
157
|
-
* children and inserting it into the priority queue. Passing an argument of
|
|
158
|
-
* NULL does nothing.
|
|
159
|
-
*/
|
|
160
|
-
private addCandidate(candidate);
|
|
161
|
-
/**
|
|
162
|
-
* Populate the children of "candidate" by expanding the given number of
|
|
163
|
-
* levels from the given cell. Returns the number of children that were marked
|
|
164
|
-
* "terminal".
|
|
165
|
-
*/
|
|
166
|
-
private expandChildren(candidate, cell, numLevels);
|
|
167
|
-
/** Computes a set of initial candidates that cover the given region. */
|
|
168
|
-
private getInitialCandidates();
|
|
169
|
-
/** Generates a covering and stores it in result. */
|
|
170
|
-
private getCoveringInternal(region);
|
|
171
|
-
}
|
package/dist/S2RegionCoverer.js
DELETED
|
@@ -1,435 +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
|
-
var S2Cell_1 = require("./S2Cell");
|
|
18
|
-
var S2CellId_1 = require("./S2CellId");
|
|
19
|
-
var S2CellUnion_1 = require("./S2CellUnion");
|
|
20
|
-
var S2Projections_1 = require("./S2Projections");
|
|
21
|
-
/**
|
|
22
|
-
* An S2RegionCoverer is a class that allows arbitrary regions to be
|
|
23
|
-
* approximated as unions of cells (S2CellUnion). This is useful for
|
|
24
|
-
* implementing various sorts of search and precomputation operations.
|
|
25
|
-
*
|
|
26
|
-
* Typical usage: {@code S2RegionCoverer coverer; coverer.setMaxCells(5); S2Cap
|
|
27
|
-
* cap = S2Cap.fromAxisAngle(...); S2CellUnion covering;
|
|
28
|
-
* coverer.getCovering(cap, covering); * }
|
|
29
|
-
*
|
|
30
|
-
* This yields a cell union of at most 5 cells that is guaranteed to cover the
|
|
31
|
-
* given cap (a disc-shaped region on the sphere).
|
|
32
|
-
*
|
|
33
|
-
* The approximation algorithm is not optimal but does a pretty good job in
|
|
34
|
-
* practice. The output does not always use the maximum number of cells allowed,
|
|
35
|
-
* both because this would not always yield a better approximation, and because
|
|
36
|
-
* max_cells() is a limit on how much work is done exploring the possible
|
|
37
|
-
* covering as well as a limit on the final output size.
|
|
38
|
-
*
|
|
39
|
-
* One can also generate interior coverings, which are sets of cells which are
|
|
40
|
-
* entirely contained within a region. Interior coverings can be empty, even for
|
|
41
|
-
* non-empty regions, if there are no cells that satisfy the provided
|
|
42
|
-
* constraints and are contained by the region. Note that for performance
|
|
43
|
-
* reasons, it is wise to specify a max_level when computing interior coverings
|
|
44
|
-
* - otherwise for regions with small or zero area, the algorithm may spend a
|
|
45
|
-
* lot of time subdividing cells all the way to leaf level to try to find
|
|
46
|
-
* contained cells.
|
|
47
|
-
*
|
|
48
|
-
* This class is thread-unsafe. Simultaneous calls to any of the getCovering
|
|
49
|
-
* methods will conflict and produce unpredictable results.
|
|
50
|
-
*
|
|
51
|
-
*/
|
|
52
|
-
var S2RegionCoverer = (function () {
|
|
53
|
-
/**
|
|
54
|
-
* Default constructor, sets all fields to default values.
|
|
55
|
-
*/
|
|
56
|
-
function S2RegionCoverer() {
|
|
57
|
-
this.minLevel = 0;
|
|
58
|
-
this.maxLevel = S2CellId_1.S2CellId.MAX_LEVEL;
|
|
59
|
-
this.levelMod = 1;
|
|
60
|
-
this.maxCells = S2RegionCoverer.DEFAULT_MAX_CELLS;
|
|
61
|
-
this.region = null;
|
|
62
|
-
this.result = [];
|
|
63
|
-
this.candidateQueue = new PriorityQueue();
|
|
64
|
-
}
|
|
65
|
-
// Set the minimum and maximum cell level to be used. The default is to use
|
|
66
|
-
// all cell levels. Requires: max_level() >= min_level().
|
|
67
|
-
//
|
|
68
|
-
// To find the cell level corresponding to a given physical distance, use
|
|
69
|
-
// the S2Cell metrics defined in s2.h. For example, to find the cell
|
|
70
|
-
// level that corresponds to an average edge length of 10km, use:
|
|
71
|
-
//
|
|
72
|
-
// int level = S2::kAvgEdge.GetClosestLevel(
|
|
73
|
-
// geostore::S2Earth::KmToRadians(length_km));
|
|
74
|
-
//
|
|
75
|
-
// Note: min_level() takes priority over max_cells(), i.e. cells below the
|
|
76
|
-
// given level will never be used even if this causes a large number of
|
|
77
|
-
// cells to be returned.
|
|
78
|
-
/**
|
|
79
|
-
* Sets the minimum level to be used.
|
|
80
|
-
*/
|
|
81
|
-
S2RegionCoverer.prototype.setMinLevel = function (minLevel) {
|
|
82
|
-
// assert (minLevel >= 0 && minLevel <= S2CellId.MAX_LEVEL);
|
|
83
|
-
this.minLevel = Math.max(0, Math.min(S2CellId_1.S2CellId.MAX_LEVEL, minLevel));
|
|
84
|
-
return this;
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* Sets the maximum level to be used.
|
|
88
|
-
*/
|
|
89
|
-
S2RegionCoverer.prototype.setMaxLevel = function (maxLevel) {
|
|
90
|
-
// assert (maxLevel >= 0 && maxLevel <= S2CellId.MAX_LEVEL);
|
|
91
|
-
this.maxLevel = Math.max(0, Math.min(S2CellId_1.S2CellId.MAX_LEVEL, maxLevel));
|
|
92
|
-
return this;
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* If specified, then only cells where (level - min_level) is a multiple of
|
|
96
|
-
* "level_mod" will be used (default 1). This effectively allows the branching
|
|
97
|
-
* factor of the S2CellId hierarchy to be increased. Currently the only
|
|
98
|
-
* parameter values allowed are 1, 2, or 3, corresponding to branching factors
|
|
99
|
-
* of 4, 16, and 64 respectively.
|
|
100
|
-
*/
|
|
101
|
-
S2RegionCoverer.prototype.setLevelMod = function (levelMod) {
|
|
102
|
-
// assert (levelMod >= 1 && levelMod <= 3);
|
|
103
|
-
this.levelMod = Math.max(1, Math.min(3, levelMod));
|
|
104
|
-
return this;
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* Sets the maximum desired number of cells in the approximation (defaults to
|
|
108
|
-
* kDefaultMaxCells). Note the following:
|
|
109
|
-
*
|
|
110
|
-
* <ul>
|
|
111
|
-
* <li>For any setting of max_cells(), up to 6 cells may be returned if that
|
|
112
|
-
* is the minimum number of cells required (e.g. if the region intersects all
|
|
113
|
-
* six face cells). Up to 3 cells may be returned even for very tiny convex
|
|
114
|
-
* regions if they happen to be located at the intersection of three cube
|
|
115
|
-
* faces.
|
|
116
|
-
*
|
|
117
|
-
* <li>For any setting of max_cells(), an arbitrary number of cells may be
|
|
118
|
-
* returned if min_level() is too high for the region being approximated.
|
|
119
|
-
*
|
|
120
|
-
* <li>If max_cells() is less than 4, the area of the covering may be
|
|
121
|
-
* arbitrarily large compared to the area of the original region even if the
|
|
122
|
-
* region is convex (e.g. an S2Cap or S2LatLngRect).
|
|
123
|
-
* </ul>
|
|
124
|
-
*
|
|
125
|
-
* Accuracy is measured by dividing the area of the covering by the area of
|
|
126
|
-
* the original region. The following table shows the median and worst case
|
|
127
|
-
* values for this area ratio on a test case consisting of 100,000 spherical
|
|
128
|
-
* caps of random size (generated using s2regioncoverer_unittest):
|
|
129
|
-
*
|
|
130
|
-
* <pre>
|
|
131
|
-
* max_cells: 3 4 5 6 8 12 20 100 1000
|
|
132
|
-
* median ratio: 5.33 3.32 2.73 2.34 1.98 1.66 1.42 1.11 1.01
|
|
133
|
-
* worst case: 215518 14.41 9.72 5.26 3.91 2.75 1.92 1.20 1.02
|
|
134
|
-
* </pre>
|
|
135
|
-
*/
|
|
136
|
-
S2RegionCoverer.prototype.setMaxCells = function (maxCells) {
|
|
137
|
-
this.maxCells = maxCells;
|
|
138
|
-
return this;
|
|
139
|
-
};
|
|
140
|
-
/**
|
|
141
|
-
* Computes a list of cell ids that covers the given region and satisfies the
|
|
142
|
-
* various restrictions specified above.
|
|
143
|
-
*
|
|
144
|
-
* @param region The region to cover
|
|
145
|
-
* @param covering The list filled in by this method
|
|
146
|
-
*/
|
|
147
|
-
S2RegionCoverer.prototype.getCoveringCells = function (region) {
|
|
148
|
-
// Rather than just returning the raw list of cell ids generated by
|
|
149
|
-
// GetCoveringInternal(), we construct a cell union and then denormalize it.
|
|
150
|
-
// This has the effect of replacing four child cells with their parent
|
|
151
|
-
// whenever this does not violate the covering parameters specified
|
|
152
|
-
// (min_level, level_mod, etc). This strategy significantly reduces the
|
|
153
|
-
// number of cells returned in many cases, and it is cheap compared to
|
|
154
|
-
// computing the covering in the first place.
|
|
155
|
-
var tmp = this.getCoveringUnion(region);
|
|
156
|
-
return tmp.denormalize(this.minLevel, this.levelMod);
|
|
157
|
-
};
|
|
158
|
-
/**
|
|
159
|
-
* Computes a list of cell ids that is contained within the given region and
|
|
160
|
-
* satisfies the various restrictions specified above.
|
|
161
|
-
*
|
|
162
|
-
* @param region The region to fill
|
|
163
|
-
* @param interior The list filled in by this method
|
|
164
|
-
*/
|
|
165
|
-
S2RegionCoverer.prototype.getInteriorCoveringCells = function (region) {
|
|
166
|
-
var tmp = this.getInteriorCoveringUnion(region);
|
|
167
|
-
return tmp.denormalize(this.minLevel, this.levelMod);
|
|
168
|
-
};
|
|
169
|
-
/**
|
|
170
|
-
* Return a normalized cell union that covers the given region and satisfies
|
|
171
|
-
* the restrictions *EXCEPT* for min_level() and level_mod(). These criteria
|
|
172
|
-
* cannot be satisfied using a cell union because cell unions are
|
|
173
|
-
* automatically normalized by replacing four child cells with their parent
|
|
174
|
-
* whenever possible. (Note that the list of cell ids passed to the cell union
|
|
175
|
-
* constructor does in fact satisfy all the given restrictions.)
|
|
176
|
-
*/
|
|
177
|
-
S2RegionCoverer.prototype.getCoveringUnion = function (region, covering) {
|
|
178
|
-
if (covering === void 0) { covering = new S2CellUnion_1.S2CellUnion(); }
|
|
179
|
-
this.interiorCovering = false;
|
|
180
|
-
this.getCoveringInternal(region);
|
|
181
|
-
covering.initSwap(this.result);
|
|
182
|
-
return covering;
|
|
183
|
-
};
|
|
184
|
-
/**
|
|
185
|
-
* Return a normalized cell union that is contained within the given region
|
|
186
|
-
* and satisfies the restrictions *EXCEPT* for min_level() and level_mod().
|
|
187
|
-
*/
|
|
188
|
-
S2RegionCoverer.prototype.getInteriorCoveringUnion = function (region, covering) {
|
|
189
|
-
if (covering === void 0) { covering = new S2CellUnion_1.S2CellUnion(); }
|
|
190
|
-
this.interiorCovering = true;
|
|
191
|
-
this.getCoveringInternal(region);
|
|
192
|
-
covering.initSwap(this.result);
|
|
193
|
-
return covering;
|
|
194
|
-
};
|
|
195
|
-
// /**
|
|
196
|
-
// * Given a connected region and a starting point, return a set of cells at the
|
|
197
|
-
// * given level that cover the region.
|
|
198
|
-
// */
|
|
199
|
-
// public static getSimpleCovering(
|
|
200
|
-
// region:S2Region , start:S2Point , level:number):S2CellId[] {
|
|
201
|
-
// S2RegionCoverer.floodFill(region, S2CellId.fromPoint(start).parentL(level));
|
|
202
|
-
// }
|
|
203
|
-
/**
|
|
204
|
-
* If the cell intersects the given region, return a new candidate with no
|
|
205
|
-
* children, otherwise return null. Also marks the candidate as "terminal" if
|
|
206
|
-
* it should not be expanded further.
|
|
207
|
-
*/
|
|
208
|
-
S2RegionCoverer.prototype.newCandidate = function (cell) {
|
|
209
|
-
if (!this.region.mayIntersectC(cell)) {
|
|
210
|
-
// console.log("NOT INTERSECTING",this.region);
|
|
211
|
-
return null;
|
|
212
|
-
}
|
|
213
|
-
var isTerminal = false;
|
|
214
|
-
if (cell.level >= this.minLevel) {
|
|
215
|
-
if (this.interiorCovering) {
|
|
216
|
-
if (this.region.containsC(cell)) {
|
|
217
|
-
isTerminal = true;
|
|
218
|
-
}
|
|
219
|
-
else if (cell.level + this.levelMod > this.maxLevel) {
|
|
220
|
-
return null;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
else {
|
|
224
|
-
if (cell.level + this.levelMod > this.maxLevel || this.region.containsC(cell)) {
|
|
225
|
-
isTerminal = true;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
var candidate = new Candidate();
|
|
230
|
-
candidate.cell = cell;
|
|
231
|
-
candidate.isTerminal = isTerminal;
|
|
232
|
-
candidate.numChildren = 0;
|
|
233
|
-
if (!isTerminal) {
|
|
234
|
-
candidate.children = Array.apply(null, new Array(1 << this.maxChildrenShift()));
|
|
235
|
-
}
|
|
236
|
-
this.candidatesCreatedCounter++;
|
|
237
|
-
return candidate;
|
|
238
|
-
};
|
|
239
|
-
/** Return the log base 2 of the maximum number of children of a candidate. */
|
|
240
|
-
S2RegionCoverer.prototype.maxChildrenShift = function () {
|
|
241
|
-
return 2 * this.levelMod;
|
|
242
|
-
};
|
|
243
|
-
/**
|
|
244
|
-
* Process a candidate by either adding it to the result list or expanding its
|
|
245
|
-
* children and inserting it into the priority queue. Passing an argument of
|
|
246
|
-
* NULL does nothing.
|
|
247
|
-
*/
|
|
248
|
-
S2RegionCoverer.prototype.addCandidate = function (candidate) {
|
|
249
|
-
if (candidate == null) {
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
if (candidate.isTerminal) {
|
|
253
|
-
this.result.push(candidate.cell.id);
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
// assert (candidate.numChildren == 0);
|
|
257
|
-
// Expand one level at a time until we hit min_level_ to ensure that
|
|
258
|
-
// we don't skip over it.
|
|
259
|
-
var numLevels = (candidate.cell.level < this.minLevel) ? 1 : this.levelMod;
|
|
260
|
-
var numTerminals = this.expandChildren(candidate, candidate.cell, numLevels);
|
|
261
|
-
if (candidate.numChildren == 0) {
|
|
262
|
-
}
|
|
263
|
-
else if (!this.interiorCovering && numTerminals == 1 << this.maxChildrenShift()
|
|
264
|
-
&& candidate.cell.level >= this.minLevel) {
|
|
265
|
-
// Optimization: add the parent cell rather than all of its children.
|
|
266
|
-
// We can't do this for interior coverings, since the children just
|
|
267
|
-
// intersect the region, but may not be contained by it - we need to
|
|
268
|
-
// subdivide them further.
|
|
269
|
-
candidate.isTerminal = true;
|
|
270
|
-
this.addCandidate(candidate);
|
|
271
|
-
}
|
|
272
|
-
else {
|
|
273
|
-
// We negate the priority so that smaller absolute priorities are returned
|
|
274
|
-
// first. The heuristic is designed to refine the largest cells first,
|
|
275
|
-
// since those are where we have the largest potential gain. Among cells
|
|
276
|
-
// at the same level, we prefer the cells with the smallest number of
|
|
277
|
-
// intersecting children. Finally, we prefer cells that have the smallest
|
|
278
|
-
// number of children that cannot be refined any further.
|
|
279
|
-
var priority = -((((candidate.cell.level << this.maxChildrenShift()) + candidate.numChildren)
|
|
280
|
-
<< this.maxChildrenShift()) + numTerminals);
|
|
281
|
-
this.candidateQueue.add(new QueueEntry(priority, candidate));
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
|
-
/**
|
|
285
|
-
* Populate the children of "candidate" by expanding the given number of
|
|
286
|
-
* levels from the given cell. Returns the number of children that were marked
|
|
287
|
-
* "terminal".
|
|
288
|
-
*/
|
|
289
|
-
S2RegionCoverer.prototype.expandChildren = function (candidate, cell, numLevels) {
|
|
290
|
-
numLevels--;
|
|
291
|
-
var childCells = cell.subdivide();
|
|
292
|
-
var numTerminals = 0;
|
|
293
|
-
for (var i = 0; i < 4; ++i) {
|
|
294
|
-
if (numLevels > 0) {
|
|
295
|
-
if (this.region.mayIntersectC(childCells[i])) {
|
|
296
|
-
numTerminals += this.expandChildren(candidate, childCells[i], numLevels);
|
|
297
|
-
}
|
|
298
|
-
continue;
|
|
299
|
-
}
|
|
300
|
-
var child = this.newCandidate(childCells[i]);
|
|
301
|
-
if (child != null) {
|
|
302
|
-
candidate.children[candidate.numChildren++] = child;
|
|
303
|
-
if (child.isTerminal) {
|
|
304
|
-
++numTerminals;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
return numTerminals;
|
|
309
|
-
};
|
|
310
|
-
/** Computes a set of initial candidates that cover the given region. */
|
|
311
|
-
S2RegionCoverer.prototype.getInitialCandidates = function () {
|
|
312
|
-
// Optimization: if at least 4 cells are desired (the normal case),
|
|
313
|
-
// start with a 4-cell covering of the region's bounding cap. This
|
|
314
|
-
// lets us skip quite a few levels of refinement when the region to
|
|
315
|
-
// be covered is relatively small.
|
|
316
|
-
if (this.maxCells >= 4) {
|
|
317
|
-
// Find the maximum level such that the bounding cap contains at most one
|
|
318
|
-
// cell vertex at that level.
|
|
319
|
-
var cap = this.region.getCapBound();
|
|
320
|
-
var level = Math.min(S2Projections_1.S2Projections.MIN_WIDTH.getMaxLevel(cap.angle().radians * 2), Math.min(this.maxLevel, S2CellId_1.S2CellId.MAX_LEVEL - 1));
|
|
321
|
-
if (this.levelMod > 1 && level > this.minLevel) {
|
|
322
|
-
level -= (level - this.minLevel) % this.levelMod;
|
|
323
|
-
}
|
|
324
|
-
// We don't bother trying to optimize the level == 0 case, since more than
|
|
325
|
-
// four face cells may be required.
|
|
326
|
-
if (level > 0) {
|
|
327
|
-
// Find the leaf cell containing the cap axis, and determine which
|
|
328
|
-
// subcell of the parent cell contains it.
|
|
329
|
-
// ArrayList<S2CellId> base = new ArrayList<>(4);
|
|
330
|
-
var id = S2CellId_1.S2CellId.fromPoint(cap.axis);
|
|
331
|
-
var base = id.getVertexNeighbors(level);
|
|
332
|
-
for (var i = 0; i < base.length; ++i) {
|
|
333
|
-
this.addCandidate(this.newCandidate(new S2Cell_1.S2Cell(base[i])));
|
|
334
|
-
}
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
// Default: start with all six cube faces.
|
|
339
|
-
for (var face = 0; face < 6; ++face) {
|
|
340
|
-
this.addCandidate(this.newCandidate(S2RegionCoverer.FACE_CELLS[face]));
|
|
341
|
-
}
|
|
342
|
-
};
|
|
343
|
-
/** Generates a covering and stores it in result. */
|
|
344
|
-
S2RegionCoverer.prototype.getCoveringInternal = function (region) {
|
|
345
|
-
// Strategy: Start with the 6 faces of the cube. Discard any
|
|
346
|
-
// that do not intersect the shape. Then repeatedly choose the
|
|
347
|
-
// largest cell that intersects the shape and subdivide it.
|
|
348
|
-
//
|
|
349
|
-
// result contains the cells that will be part of the output, while the
|
|
350
|
-
// priority queue contains cells that we may still subdivide further. Cells
|
|
351
|
-
// that are entirely contained within the region are immediately added to
|
|
352
|
-
// the output, while cells that do not intersect the region are immediately
|
|
353
|
-
// discarded.
|
|
354
|
-
// Therefore pq_ only contains cells that partially intersect the region.
|
|
355
|
-
// Candidates are prioritized first according to cell size (larger cells
|
|
356
|
-
// first), then by the number of intersecting children they have (fewest
|
|
357
|
-
// children first), and then by the number of fully contained children
|
|
358
|
-
// (fewest children first).
|
|
359
|
-
if (!(this.candidateQueue.size() == 0 && this.result.length == 0)) {
|
|
360
|
-
throw new Error('preconditions are not satisfied');
|
|
361
|
-
}
|
|
362
|
-
// Preconditions.checkState(this.candidateQueue.isEmpty() && this.result.isEmpty());
|
|
363
|
-
this.region = region;
|
|
364
|
-
this.candidatesCreatedCounter = 0;
|
|
365
|
-
this.getInitialCandidates();
|
|
366
|
-
while (this.candidateQueue.size() !== 0 && (!this.interiorCovering || this.result.length < this.maxCells)) {
|
|
367
|
-
var candidate = this.candidateQueue.poll().candidate;
|
|
368
|
-
// logger.info("Pop: " + candidate.cell.id());
|
|
369
|
-
if (candidate.cell.level < this.minLevel || candidate.numChildren == 1
|
|
370
|
-
|| this.result.length + (this.interiorCovering ? 0 : this.candidateQueue.size()) + candidate.numChildren
|
|
371
|
-
<= this.maxCells) {
|
|
372
|
-
// Expand this candidate into its children.
|
|
373
|
-
for (var i = 0; i < candidate.numChildren; ++i) {
|
|
374
|
-
this.addCandidate(candidate.children[i]);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
else if (this.interiorCovering) {
|
|
378
|
-
}
|
|
379
|
-
else {
|
|
380
|
-
candidate.isTerminal = true;
|
|
381
|
-
this.addCandidate(candidate);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
this.candidateQueue.clear();
|
|
385
|
-
this.region = null;
|
|
386
|
-
};
|
|
387
|
-
/**
|
|
388
|
-
* By default, the covering uses at most 8 cells at any level. This gives a
|
|
389
|
-
* reasonable tradeoff between the number of cells used and the accuracy of
|
|
390
|
-
* the approximation (see table below).
|
|
391
|
-
*/
|
|
392
|
-
S2RegionCoverer.DEFAULT_MAX_CELLS = 8;
|
|
393
|
-
S2RegionCoverer.FACE_CELLS = [0, 1, 2, 3, 4, 5].map(function (face) { return S2Cell_1.S2Cell.fromFacePosLevel(face, 0, 0); });
|
|
394
|
-
return S2RegionCoverer;
|
|
395
|
-
}());
|
|
396
|
-
exports.S2RegionCoverer = S2RegionCoverer;
|
|
397
|
-
var Candidate = (function () {
|
|
398
|
-
function Candidate() {
|
|
399
|
-
}
|
|
400
|
-
// elements.
|
|
401
|
-
Candidate.prototype.toString = function () {
|
|
402
|
-
return "isTermina: " + this.isTerminal + " - Cell: " + this.cell.toString();
|
|
403
|
-
};
|
|
404
|
-
return Candidate;
|
|
405
|
-
}());
|
|
406
|
-
var PriorityQueue = (function () {
|
|
407
|
-
function PriorityQueue() {
|
|
408
|
-
this.clear();
|
|
409
|
-
}
|
|
410
|
-
PriorityQueue.prototype.add = function (item) {
|
|
411
|
-
this.items.push(item);
|
|
412
|
-
this.items.sort(function (a, b) { return a.compare(b); });
|
|
413
|
-
};
|
|
414
|
-
PriorityQueue.prototype.clear = function () {
|
|
415
|
-
this.items = [];
|
|
416
|
-
};
|
|
417
|
-
PriorityQueue.prototype.size = function () {
|
|
418
|
-
return this.items.length;
|
|
419
|
-
};
|
|
420
|
-
PriorityQueue.prototype.poll = function () {
|
|
421
|
-
return this.items.splice(0, 1)[0];
|
|
422
|
-
};
|
|
423
|
-
return PriorityQueue;
|
|
424
|
-
}());
|
|
425
|
-
var QueueEntry = (function () {
|
|
426
|
-
function QueueEntry(id, candidate) {
|
|
427
|
-
this.id = id;
|
|
428
|
-
this.candidate = candidate;
|
|
429
|
-
}
|
|
430
|
-
QueueEntry.prototype.compare = function (other) {
|
|
431
|
-
return this.id < other.id ? 1 : (this.id > other.id ? -1 : 0);
|
|
432
|
-
};
|
|
433
|
-
return QueueEntry;
|
|
434
|
-
}());
|
|
435
|
-
//# sourceMappingURL=S2RegionCoverer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"S2RegionCoverer.js","sourceRoot":"","sources":["../src/S2RegionCoverer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAEH,uBAAqB,UAAU,CAAC,CAAA;AAEhC,yBAAuB,YAAY,CAAC,CAAA;AACpC,4BAA0B,eAAe,CAAC,CAAA;AAC1C,8BAA4B,iBAAiB,CAAC,CAAA;AAC9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH;IA4CE;;OAEG;IACH;QACE,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,mBAAQ,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,eAAe,CAAC,iBAAiB,CAAC;QAClD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,MAAM,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