@koopjs/winnow
Advanced tools
Comparing version 5.0.2 to 5.0.3
{ | ||
"name": "@koopjs/winnow", | ||
"version": "5.0.2", | ||
"version": "5.0.3", | ||
"description": "Apply sql-like filters to GeoJSON", | ||
@@ -50,3 +50,2 @@ "main": "src/index.js", | ||
"@terraformer/arcgis": "^2.1.2", | ||
"@terraformer/spatial": "^2.1.2", | ||
"@turf/bbox-polygon": "^6.5.0", | ||
@@ -61,3 +60,3 @@ "@turf/boolean-contains": "^6.5.0", | ||
"@types/geojson": "^7946.0.14", | ||
"alasql": "^4.3.3", | ||
"alasql": "^4.4.0", | ||
"classybrew": "0.0.3", | ||
@@ -79,3 +78,3 @@ "joi": "^17.13.1", | ||
"proxyquire": "^2.1.3", | ||
"sinon": "^17.0.1", | ||
"sinon": "^18.0.0", | ||
"tap-min": "^3.0.0", | ||
@@ -82,0 +81,0 @@ "tape": "^5.7.5" |
@@ -8,11 +8,19 @@ const Classifier = require('classybrew'); | ||
function calculateClassBreaks(features, classification) { | ||
if (!classification.method) throw new Error('must supply classification.method'); | ||
if (!classification.breakCount) throw new Error('must supply classification.breakCount'); | ||
if (!classification.method) { | ||
throw new Error('must supply classification.method'); | ||
} | ||
if (!classification.breakCount) { | ||
throw new Error('must supply classification.breakCount'); | ||
} | ||
const values = classification.normType | ||
? normalizeClassificationValues(features, classification) | ||
: getFieldValues(features, classification.field); | ||
// limit break count to num values | ||
if (classification.breakCount > values.length) classification.breakCount = values.length; | ||
// limit break count to num values - 1; [1, 2, 3, 4, 5, 6] => [1-2, 2-3, 3-4, 4-5, 5-6] | ||
if (classification.breakCount > values.length) { | ||
classification.breakCount = values.length - 1; | ||
} | ||
// calculate break ranges [ [a-b], [b-c], ...] from input values | ||
@@ -19,0 +27,0 @@ const classBreakArray = transformValuesToClassBreaksArray(values, classification); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90316
24
2238
- Removed@terraformer/spatial@^2.1.2
- Removed@terraformer/spatial@2.2.1(transitive)
Updatedalasql@^4.4.0