@dra2020/district-analytics 8.2.5 → 8.2.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.
@@ -1223,10 +1223,11 @@ function extractDistrictProperties(s, bLog = false) {
1223
1223
  }
1224
1224
  exports.extractDistrictProperties = extractDistrictProperties;
1225
1225
  function isAShape(poly) {
1226
- const bPolyUndefined = (poly === undefined) ? true : false;
1227
- const bNull = (bPolyUndefined) ? true : Poly.polyNull(poly); // TODO - poly
1228
- const bNoCoordinates = U.isArrayEmpty((poly.geometry.coordinates)) ? true : false;
1229
- return (!bPolyUndefined && !bNull && !bNoCoordinates);
1226
+ if (poly == null)
1227
+ return false;
1228
+ if (Poly.polyNull(poly))
1229
+ return false;
1230
+ return poly.geometry && poly.geometry.coordinates && !U.isArrayEmpty(poly.geometry.coordinates);
1230
1231
  }
1231
1232
  // SCORE KIWYSI COMPACTNESS
1232
1233
  function scoreKIWYSICompactness(s, bLog = false) {