@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/lib/geo/geo.ts
CHANGED
|
@@ -56,25 +56,7 @@ export function geoNormalizeFeature(f: any, options?: NormalizeOptions): GeoFeat
|
|
|
56
56
|
{
|
|
57
57
|
options = Util.shallowAssignImmutable({}, options);
|
|
58
58
|
|
|
59
|
-
if (
|
|
60
|
-
{
|
|
61
|
-
let multiPoly = f.geometry.coordinates;
|
|
62
|
-
|
|
63
|
-
// Convert degenerate MultiPolygon to Polygon
|
|
64
|
-
if (multiPoly.length == 1)
|
|
65
|
-
{
|
|
66
|
-
f.geometry.type = 'Polygon';
|
|
67
|
-
f.geometry.coordinates = multiPoly[0];
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
else if (f && f.geometry && f.geometry.type === 'Point' && f.geometry.coordinates)
|
|
71
|
-
{
|
|
72
|
-
while (Array.isArray(f.geometry.coordinates[0]))
|
|
73
|
-
f.geometry.coordinates = f.geometry.coordinates[0];
|
|
74
|
-
}
|
|
75
|
-
else if (options.checkRewind)
|
|
76
|
-
// Various tools do not guarantee valid GeoJSON winding rules. Verify it since internal processing
|
|
77
|
-
// assumes it is correct.
|
|
59
|
+
if (options.checkRewind)
|
|
78
60
|
Poly.featureRewind(f);
|
|
79
61
|
|
|
80
62
|
return f;
|
package/lib/poly/poly.ts
CHANGED
|
@@ -775,7 +775,7 @@ export function featureRewind(f: any, options?: RewindOptions): any
|
|
|
775
775
|
let iPoly: number;
|
|
776
776
|
for (; iWinding < windings.length; iWinding++)
|
|
777
777
|
{
|
|
778
|
-
let good = misWound(windings[iWinding]);
|
|
778
|
+
let good = !misWound(windings[iWinding]);
|
|
779
779
|
if (!good && iWinding == 0) // First is miswound - no good
|
|
780
780
|
break;
|
|
781
781
|
if (good)
|
|
@@ -801,7 +801,7 @@ export function featureRewind(f: any, options?: RewindOptions): any
|
|
|
801
801
|
let polys = f.geometry.coordinates;
|
|
802
802
|
windings = polyRingWindings(f);
|
|
803
803
|
windings.forEach((w: Winding) => {
|
|
804
|
-
let good = misWound(w);
|
|
804
|
+
let good = !misWound(w);
|
|
805
805
|
if (!good)
|
|
806
806
|
{
|
|
807
807
|
let ring = polys[w.iPoly][w.iRing];
|
package/lib/poly/topo.ts
CHANGED
|
@@ -65,28 +65,7 @@ function ringsCancel(outerPoly: any, innerRing: any): boolean
|
|
|
65
65
|
|
|
66
66
|
function correctGeometry(f: any): any
|
|
67
67
|
{
|
|
68
|
-
|
|
69
|
-
{
|
|
70
|
-
let multiPoly = f.geometry.coordinates;
|
|
71
|
-
|
|
72
|
-
// Convert degenerate MultiPolygon to Polygon
|
|
73
|
-
if (multiPoly.length == 1)
|
|
74
|
-
{
|
|
75
|
-
f.geometry.type = 'Polygon';
|
|
76
|
-
f.geometry.coordinates = multiPoly[0];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (f && f.geometry && f.geometry.type === 'Point' && f.geometry.coordinates)
|
|
81
|
-
{
|
|
82
|
-
while (Array.isArray(f.geometry.coordinates[0]))
|
|
83
|
-
f.geometry.coordinates = f.geometry.coordinates[0];
|
|
84
|
-
}
|
|
85
|
-
else
|
|
86
|
-
// TopoJSON does not guarantee proper winding order which messes up later processing. Fix it.
|
|
87
|
-
P.featureRewind(f, { validateHoles: false } );
|
|
88
|
-
|
|
89
|
-
return f;
|
|
68
|
+
return P.featureRewind(f, { validateHoles: false } );
|
|
90
69
|
}
|
|
91
70
|
|
|
92
71
|
export function topoContiguity(topo: Topo): any
|