@dra2020/district-analytics 5.3.2 → 5.3.3
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/cli.js +1793 -3526
- package/dist/cli.js.map +1 -1
- package/dist/district-analytics.js +7 -7
- package/dist/district-analytics.js.map +1 -1
- package/package.json +2 -2
|
@@ -1119,15 +1119,15 @@ const Poly = __importStar(__webpack_require__(/*! @dra2020/poly */ "@dra2020/pol
|
|
|
1119
1119
|
function extractDistrictProperties(s, bLog = false) {
|
|
1120
1120
|
// NOTE - I am assuming that district IDs are integers 1–N
|
|
1121
1121
|
for (let i = 1; i <= s.state.nDistricts; i++) {
|
|
1122
|
-
|
|
1122
|
+
const poly = s.districts.getDistrictShapeByID(i);
|
|
1123
1123
|
// Guard against no shape for empty districts AND null shapes
|
|
1124
|
-
|
|
1125
|
-
if (
|
|
1124
|
+
const bNull = Poly.polyNull(poly);
|
|
1125
|
+
if (!bNull) {
|
|
1126
1126
|
// TODO - OPTIMIZE: Bundle these calls?
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1127
|
+
const area = Poly.polyAreaFlat(poly);
|
|
1128
|
+
const perimeter = Poly.polyPerimeterFlat(poly);
|
|
1129
|
+
const diameter = Poly.polyDiameterFlat(poly);
|
|
1130
|
+
const props = [0, 0, 0]; // TODO - TERRY?!?
|
|
1131
1131
|
props[0 /* Area */] = area;
|
|
1132
1132
|
props[1 /* Diameter */] = diameter;
|
|
1133
1133
|
props[2 /* Perimeter */] = perimeter;
|