@dra2020/baseclient 1.0.45 → 1.0.48
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 +10 -7
- package/dist/baseclient.js.map +1 -1
- package/lib/poly/topo.ts +9 -6
- package/package.json +1 -1
package/lib/poly/topo.ts
CHANGED
|
@@ -184,7 +184,7 @@ function misMatchObject(o1: any, o2: any): boolean
|
|
|
184
184
|
return (o1.type === 'MultiPolygon') ? misMatchMulti(o1.arcs, o2.arcs) : misMatchPoly(o1.arcs, o2.arcs);
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
const MAX_TRIES =
|
|
187
|
+
const MAX_TRIES = 30;
|
|
188
188
|
|
|
189
189
|
function bigTimeString(ms: number): string
|
|
190
190
|
{
|
|
@@ -221,7 +221,7 @@ const DefaultSimplifyOptions: SimplifyOptions = { minArea: 500 };
|
|
|
221
221
|
|
|
222
222
|
function log(s: string): void
|
|
223
223
|
{
|
|
224
|
-
|
|
224
|
+
console.log(s);
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
//
|
|
@@ -313,6 +313,7 @@ export function topoSimplifyCollection(col: any, options?: SimplifyOptions): any
|
|
|
313
313
|
if (! bDecided)
|
|
314
314
|
{
|
|
315
315
|
let pp = PP.polyPackTopoArcs(testtopo, arcs);
|
|
316
|
+
P.polyRewindRings(pp);
|
|
316
317
|
if (selfIntersectFast(pp))
|
|
317
318
|
{
|
|
318
319
|
keepArcs(topo, oOld.arcs, keepweight);
|
|
@@ -321,11 +322,13 @@ export function topoSimplifyCollection(col: any, options?: SimplifyOptions): any
|
|
|
321
322
|
else
|
|
322
323
|
{
|
|
323
324
|
let {x,y} = intpt(f);
|
|
324
|
-
|
|
325
|
+
let d = PL.polyDistance(pp, x, y);
|
|
326
|
+
if (d < 0.00001) // d is negative if outside the polygon, so that qualifies here
|
|
325
327
|
{
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
328
|
+
keepTiny.set(f, f);
|
|
329
|
+
keepArcs(topo, oOld.arcs, 0); // keeps all points to avoid reprocessing these tiny shapes
|
|
330
|
+
nBad++, nTiny++;
|
|
331
|
+
log(`topoSimplifyCollection: ${f.properties.id}: increasing feature fidelity because intpt dist is ${d}`);
|
|
329
332
|
}
|
|
330
333
|
}
|
|
331
334
|
}
|