@dra2020/baseclient 1.0.61 → 1.0.64
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 +4 -33
- package/dist/baseclient.js.map +1 -1
- package/lib/geo/geo.ts +1 -19
- package/lib/poly/poly.ts +2 -2
- package/lib/poly/topo.ts +1 -22
- package/package.json +1 -1
package/dist/baseclient.js
CHANGED
|
@@ -1565,21 +1565,7 @@ function geoEnsureID(col, options) {
|
|
|
1565
1565
|
exports.geoEnsureID = geoEnsureID;
|
|
1566
1566
|
function geoNormalizeFeature(f, options) {
|
|
1567
1567
|
options = Util.shallowAssignImmutable({}, options);
|
|
1568
|
-
if (
|
|
1569
|
-
let multiPoly = f.geometry.coordinates;
|
|
1570
|
-
// Convert degenerate MultiPolygon to Polygon
|
|
1571
|
-
if (multiPoly.length == 1) {
|
|
1572
|
-
f.geometry.type = 'Polygon';
|
|
1573
|
-
f.geometry.coordinates = multiPoly[0];
|
|
1574
|
-
}
|
|
1575
|
-
}
|
|
1576
|
-
else if (f && f.geometry && f.geometry.type === 'Point' && f.geometry.coordinates) {
|
|
1577
|
-
while (Array.isArray(f.geometry.coordinates[0]))
|
|
1578
|
-
f.geometry.coordinates = f.geometry.coordinates[0];
|
|
1579
|
-
}
|
|
1580
|
-
else if (options.checkRewind)
|
|
1581
|
-
// Various tools do not guarantee valid GeoJSON winding rules. Verify it since internal processing
|
|
1582
|
-
// assumes it is correct.
|
|
1568
|
+
if (options.checkRewind)
|
|
1583
1569
|
Poly.featureRewind(f);
|
|
1584
1570
|
return f;
|
|
1585
1571
|
}
|
|
@@ -6840,7 +6826,7 @@ function featureRewind(f, options) {
|
|
|
6840
6826
|
let polys = f.geometry.coordinates;
|
|
6841
6827
|
let iPoly;
|
|
6842
6828
|
for (; iWinding < windings.length; iWinding++) {
|
|
6843
|
-
let good = misWound(windings[iWinding]);
|
|
6829
|
+
let good = !misWound(windings[iWinding]);
|
|
6844
6830
|
if (!good && iWinding == 0) // First is miswound - no good
|
|
6845
6831
|
break;
|
|
6846
6832
|
if (good)
|
|
@@ -6862,7 +6848,7 @@ function featureRewind(f, options) {
|
|
|
6862
6848
|
let polys = f.geometry.coordinates;
|
|
6863
6849
|
windings = polyRingWindings(f);
|
|
6864
6850
|
windings.forEach((w) => {
|
|
6865
|
-
let good = misWound(w);
|
|
6851
|
+
let good = !misWound(w);
|
|
6866
6852
|
if (!good) {
|
|
6867
6853
|
let ring = polys[w.iPoly][w.iRing];
|
|
6868
6854
|
let iFront = 0;
|
|
@@ -8786,22 +8772,7 @@ function ringsCancel(outerPoly, innerRing) {
|
|
|
8786
8772
|
return true;
|
|
8787
8773
|
}
|
|
8788
8774
|
function correctGeometry(f) {
|
|
8789
|
-
|
|
8790
|
-
let multiPoly = f.geometry.coordinates;
|
|
8791
|
-
// Convert degenerate MultiPolygon to Polygon
|
|
8792
|
-
if (multiPoly.length == 1) {
|
|
8793
|
-
f.geometry.type = 'Polygon';
|
|
8794
|
-
f.geometry.coordinates = multiPoly[0];
|
|
8795
|
-
}
|
|
8796
|
-
}
|
|
8797
|
-
if (f && f.geometry && f.geometry.type === 'Point' && f.geometry.coordinates) {
|
|
8798
|
-
while (Array.isArray(f.geometry.coordinates[0]))
|
|
8799
|
-
f.geometry.coordinates = f.geometry.coordinates[0];
|
|
8800
|
-
}
|
|
8801
|
-
else
|
|
8802
|
-
// TopoJSON does not guarantee proper winding order which messes up later processing. Fix it.
|
|
8803
|
-
P.featureRewind(f, { validateHoles: false });
|
|
8804
|
-
return f;
|
|
8775
|
+
return P.featureRewind(f, { validateHoles: false });
|
|
8805
8776
|
}
|
|
8806
8777
|
function topoContiguity(topo) {
|
|
8807
8778
|
let objects = Object.values(topo.objects);
|