@dra2020/baseclient 1.0.85 → 1.0.86
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 +1 -1
- package/dist/baseclient.js +67 -0
- package/dist/baseclient.js.map +1 -1
- package/dist/geo/all.d.ts +1 -0
- package/dist/geo/multiblockmapping.d.ts +21 -0
- package/lib/geo/all.ts +1 -0
- package/lib/geo/multiblockmapping.ts +72 -0
- package/package.json +1 -1
package/LICENSE
CHANGED
package/dist/baseclient.js
CHANGED
|
@@ -2278,6 +2278,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
2278
2278
|
__exportStar(__webpack_require__(/*! ./geo */ "./lib/geo/geo.ts"), exports);
|
|
2279
2279
|
__exportStar(__webpack_require__(/*! ./vfeature */ "./lib/geo/vfeature.ts"), exports);
|
|
2280
2280
|
__exportStar(__webpack_require__(/*! ./flexname */ "./lib/geo/flexname.ts"), exports);
|
|
2281
|
+
__exportStar(__webpack_require__(/*! ./multiblockmapping */ "./lib/geo/multiblockmapping.ts"), exports);
|
|
2281
2282
|
|
|
2282
2283
|
|
|
2283
2284
|
/***/ }),
|
|
@@ -2824,6 +2825,72 @@ function geoIntersect(multi, bbox, opt) {
|
|
|
2824
2825
|
exports.geoIntersect = geoIntersect;
|
|
2825
2826
|
|
|
2826
2827
|
|
|
2828
|
+
/***/ }),
|
|
2829
|
+
|
|
2830
|
+
/***/ "./lib/geo/multiblockmapping.ts":
|
|
2831
|
+
/*!**************************************!*\
|
|
2832
|
+
!*** ./lib/geo/multiblockmapping.ts ***!
|
|
2833
|
+
\**************************************/
|
|
2834
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
2835
|
+
|
|
2836
|
+
|
|
2837
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2838
|
+
exports.MultiBlockMapping = exports.reverseBlockMapping = void 0;
|
|
2839
|
+
function reverseBlockMapping(bm) {
|
|
2840
|
+
let rev = {};
|
|
2841
|
+
if (bm)
|
|
2842
|
+
Object.keys(bm).forEach(blockid => {
|
|
2843
|
+
let geoid = bm[blockid];
|
|
2844
|
+
if (!rev[geoid])
|
|
2845
|
+
rev[geoid] = [];
|
|
2846
|
+
rev[geoid].push(blockid);
|
|
2847
|
+
});
|
|
2848
|
+
Object.values(rev).forEach((a) => a.sort());
|
|
2849
|
+
return rev;
|
|
2850
|
+
}
|
|
2851
|
+
exports.reverseBlockMapping = reverseBlockMapping;
|
|
2852
|
+
class MultiBlockMapping {
|
|
2853
|
+
constructor(tag, bm) {
|
|
2854
|
+
this.entries = [];
|
|
2855
|
+
if (tag && bm)
|
|
2856
|
+
this.entries.push({ tag, bm });
|
|
2857
|
+
}
|
|
2858
|
+
add(tag, bm) {
|
|
2859
|
+
this.entries.forEach(e => { if (e.tag === tag) {
|
|
2860
|
+
e.bm = bm;
|
|
2861
|
+
delete e.rbm;
|
|
2862
|
+
bm = null;
|
|
2863
|
+
} });
|
|
2864
|
+
if (bm)
|
|
2865
|
+
this.entries.push({ tag, bm });
|
|
2866
|
+
}
|
|
2867
|
+
remove(tag) {
|
|
2868
|
+
for (let i = this.entries.length - 1; i >= 0; i--)
|
|
2869
|
+
if (this.entries[i].tag === tag)
|
|
2870
|
+
this.entries.splice(i, 1);
|
|
2871
|
+
}
|
|
2872
|
+
map(blockid) {
|
|
2873
|
+
for (let i = 0; i < this.entries.length; i++) {
|
|
2874
|
+
let e = this.entries[i];
|
|
2875
|
+
if (e.bm[blockid])
|
|
2876
|
+
return e.bm[blockid];
|
|
2877
|
+
}
|
|
2878
|
+
return undefined;
|
|
2879
|
+
}
|
|
2880
|
+
rev(geoid) {
|
|
2881
|
+
for (let i = 0; i < this.entries.length; i++) {
|
|
2882
|
+
let e = this.entries[i];
|
|
2883
|
+
if (!e.rbm)
|
|
2884
|
+
e.rbm = reverseBlockMapping(e.bm);
|
|
2885
|
+
if (e.rbm[geoid])
|
|
2886
|
+
return e.rbm[geoid];
|
|
2887
|
+
}
|
|
2888
|
+
return undefined;
|
|
2889
|
+
}
|
|
2890
|
+
}
|
|
2891
|
+
exports.MultiBlockMapping = MultiBlockMapping;
|
|
2892
|
+
|
|
2893
|
+
|
|
2827
2894
|
/***/ }),
|
|
2828
2895
|
|
|
2829
2896
|
/***/ "./lib/geo/vfeature.ts":
|