@dra2020/baseclient 1.0.5 → 1.0.6
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 +8 -5
- package/dist/baseclient.js.map +1 -1
- package/lib/poly/topo.ts +10 -5
- package/package.json +1 -1
package/dist/baseclient.js
CHANGED
|
@@ -8050,6 +8050,9 @@ function bigTimeString(ms) {
|
|
|
8050
8050
|
return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
|
|
8051
8051
|
}
|
|
8052
8052
|
const DefaultSimplifyOptions = { minArea: 500 };
|
|
8053
|
+
function log(s) {
|
|
8054
|
+
//console.log(s);
|
|
8055
|
+
}
|
|
8053
8056
|
//
|
|
8054
8057
|
// topoSimplifyCollection:
|
|
8055
8058
|
// This implements our simplification strategy for block/precinct level shapes. The basic idea is to
|
|
@@ -8072,10 +8075,10 @@ function topoSimplifyCollection(col, options) {
|
|
|
8072
8075
|
let elapsedTotal = new Util.Elapsed();
|
|
8073
8076
|
let elapsed = new Util.Elapsed();
|
|
8074
8077
|
let topo = topoFromCollection(col);
|
|
8075
|
-
|
|
8078
|
+
log(`topoSimplifyCollection: fromCollection: ${Math.round(elapsed.ms())}ms`);
|
|
8076
8079
|
elapsed.start();
|
|
8077
8080
|
topo = TopoSimplify.presimplify(topo, TopoSimplify['sphericalTriangleArea']);
|
|
8078
|
-
|
|
8081
|
+
log(`topoSimplifyCollection: presimplify: ${Math.round(elapsed.ms())}ms`);
|
|
8079
8082
|
elapsed.start();
|
|
8080
8083
|
// Keep iterating on removing simplification from degenerate shapes
|
|
8081
8084
|
let nTries = 1;
|
|
@@ -8131,11 +8134,11 @@ function topoSimplifyCollection(col, options) {
|
|
|
8131
8134
|
}
|
|
8132
8135
|
}
|
|
8133
8136
|
});
|
|
8134
|
-
|
|
8137
|
+
log(`topoSimplifyCollection: pass ${nTries}: ${nBad} (${nTiny} tiny) of ${col.features.length} features are degenerate`);
|
|
8135
8138
|
// If not making progress, keep more points
|
|
8136
8139
|
if (nBad >= nBadLast) {
|
|
8137
8140
|
keepweight /= 10;
|
|
8138
|
-
|
|
8141
|
+
log(`topoSimplifyCollection: pass ${nTries}: reducing weight limit to ${keepweight}`);
|
|
8139
8142
|
}
|
|
8140
8143
|
nBadLast = nBad;
|
|
8141
8144
|
if (nBad && nTries > MAX_TRIES)
|
|
@@ -8147,7 +8150,7 @@ function topoSimplifyCollection(col, options) {
|
|
|
8147
8150
|
}
|
|
8148
8151
|
nTries++;
|
|
8149
8152
|
}
|
|
8150
|
-
|
|
8153
|
+
log(`topoSimplifyCollection: total elapsed time: ${bigTimeString(elapsedTotal.ms())}`);
|
|
8151
8154
|
return col;
|
|
8152
8155
|
}
|
|
8153
8156
|
exports.topoSimplifyCollection = topoSimplifyCollection;
|