@dra2020/baseclient 1.0.104 → 1.0.108
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/dist/baseclient.js +17 -4
- package/dist/baseclient.js.map +1 -1
- package/dist/poly/topo.d.ts +5 -0
- package/lib/geo/geo.ts +10 -1
- package/lib/poly/topo.ts +9 -1
- package/package.json +2 -2
package/dist/baseclient.js
CHANGED
|
@@ -2655,6 +2655,7 @@ class GeoMultiCollection {
|
|
|
2655
2655
|
e.topo = geoCollectionToTopoNonNull(e.col);
|
|
2656
2656
|
else if (e.map) {
|
|
2657
2657
|
e.col = geoMapToCollectionNonNull(e.map);
|
|
2658
|
+
console.log(`toposplice: constructing topology for ${e.col.features.length} features`);
|
|
2658
2659
|
e.topo = geoCollectionToTopoNonNull(e.col);
|
|
2659
2660
|
}
|
|
2660
2661
|
}
|
|
@@ -2730,8 +2731,14 @@ class GeoMultiCollection {
|
|
|
2730
2731
|
this.all.col = this.all.col || e.col;
|
|
2731
2732
|
this.all.map = this.all.map || e.map;
|
|
2732
2733
|
}
|
|
2733
|
-
else
|
|
2734
|
-
|
|
2734
|
+
else {
|
|
2735
|
+
// Old-style, goes through map (to filter hidden) and then collection
|
|
2736
|
+
// this.all.topo = geoCollectionToTopoNonNull(this.allCol());
|
|
2737
|
+
// New style, use splice on packed topologies
|
|
2738
|
+
console.log(`toposplice: splicing ${this.nEntries} topologies`);
|
|
2739
|
+
let topoarray = Object.values(this.entries).map((e) => { return { topology: this._topo(e), filterout: this.hidden }; });
|
|
2740
|
+
this.all.topo = Poly.topoSplice(topoarray);
|
|
2741
|
+
}
|
|
2735
2742
|
}
|
|
2736
2743
|
return this.all.topo;
|
|
2737
2744
|
}
|
|
@@ -9794,7 +9801,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
9794
9801
|
return result;
|
|
9795
9802
|
};
|
|
9796
9803
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9797
|
-
exports.topoUnpack = exports.topoPack = exports.topoPacked = exports.FsmTopoUnion = exports.topoMergeFeatures = exports.topoMerge = exports.topoSimplifyCollection = exports.topoToCollection = exports.topoToFeature = exports.topoContiguity = exports.topoFromCollection = void 0;
|
|
9804
|
+
exports.topoUnpack = exports.topoPack = exports.topoPacked = exports.FsmTopoUnion = exports.topoMergeFeatures = exports.topoMerge = exports.topoSimplifyCollection = exports.topoToCollection = exports.topoSplice = exports.topoToFeature = exports.topoContiguity = exports.topoFromCollection = void 0;
|
|
9798
9805
|
// Forked version that supports packing
|
|
9799
9806
|
const TopoClient = __importStar(__webpack_require__(/*! @dra2020/topojson-client */ "@dra2020/topojson-client"));
|
|
9800
9807
|
// Forked version that fixes self-looping hole problem
|
|
@@ -9860,7 +9867,7 @@ function topoContiguity(topo) {
|
|
|
9860
9867
|
let objects = Object.values(topo.objects);
|
|
9861
9868
|
let geoid = getGEOID(objects);
|
|
9862
9869
|
objects.forEach((o) => { o.properties.id = o.properties[geoid]; });
|
|
9863
|
-
let neighbors = TopoClient.neighbors(objects, true);
|
|
9870
|
+
let neighbors = TopoClient.neighbors(topo, objects, true);
|
|
9864
9871
|
let result = {};
|
|
9865
9872
|
result['OUT_OF_STATE'] = [];
|
|
9866
9873
|
objects.forEach((o, i) => {
|
|
@@ -9880,6 +9887,12 @@ function topoToFeature(topo, geoid) {
|
|
|
9880
9887
|
return correctGeometry(TopoClient.feature(topo, topo.objects[geoid]));
|
|
9881
9888
|
}
|
|
9882
9889
|
exports.topoToFeature = topoToFeature;
|
|
9890
|
+
function topoSplice(topoarray) {
|
|
9891
|
+
if (topoarray)
|
|
9892
|
+
topoarray.forEach(e => topoPack(e.topology));
|
|
9893
|
+
return TopoClient.splice(topoarray);
|
|
9894
|
+
}
|
|
9895
|
+
exports.topoSplice = topoSplice;
|
|
9883
9896
|
function topoToCollection(topo) {
|
|
9884
9897
|
let col = { type: 'FeatureCollection', features: [] };
|
|
9885
9898
|
if (topo)
|