@dra2020/baseclient 1.0.41 → 1.0.44

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/lib/poly/topo.ts CHANGED
@@ -197,13 +197,13 @@ function bigTimeString(ms: number): string
197
197
  function intpt(f: any): { x: number, y: number }
198
198
  {
199
199
  let x = 0, y = 0;
200
- for (let p in ['INTPTLON20','INTPTLON10','INTPTLON','labelx'])
200
+ for (let p of ['INTPTLON20','INTPTLON10','INTPTLON','labelx'])
201
201
  if (f.properties[p] && !isNaN(Number(f.properties[p])))
202
202
  {
203
203
  x = Number(f.properties[p]);
204
204
  break;
205
205
  }
206
- for (let p in ['INTPTLAT20','INTPTLAT10','INTPTLAT','labely'])
206
+ for (let p of ['INTPTLAT20','INTPTLAT10','INTPTLAT','labely'])
207
207
  if (f.properties[p] && !isNaN(Number(f.properties[p])))
208
208
  {
209
209
  y = Number(f.properties[p]);
@@ -313,12 +313,21 @@ export function topoSimplifyCollection(col: any, options?: SimplifyOptions): any
313
313
  if (! bDecided)
314
314
  {
315
315
  let pp = PP.polyPackTopoArcs(testtopo, arcs);
316
- let {x,y} = intpt(f);
317
- if (selfIntersectFast(pp) || (x && y && !polyContainsPoint(pp, x, y)))
316
+ if (selfIntersectFast(pp))
318
317
  {
319
318
  keepArcs(topo, oOld.arcs, keepweight);
320
319
  nBad++;
321
320
  }
321
+ else
322
+ {
323
+ let {x,y} = intpt(f);
324
+ if (x && y && !polyContainsPoint(pp, x, y))
325
+ {
326
+ keepArcs(topo, oOld.arcs, keepweight);
327
+ nBad++;
328
+ log(`topoSimplifyCollection: ${f.properties.id}: increasing feature fidelity because of intpt problem`);
329
+ }
330
+ }
322
331
  }
323
332
  }
324
333
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dra2020/baseclient",
3
- "version": "1.0.41",
3
+ "version": "1.0.44",
4
4
  "description": "Utility functions for Javascript projects.",
5
5
  "main": "dist/baseclient.js",
6
6
  "types": "./dist/all/all.d.ts",