@turf/rectangle-grid
Advanced tools
Comparing version 6.2.0-alpha.2 to 6.2.0-alpha.3
@@ -37,9 +37,9 @@ import intersect from "@turf/boolean-intersects"; | ||
var north = bbox[3]; | ||
var xFraction = cellWidth / (distance([west, south], [east, south], options)); | ||
var xFraction = cellWidth / distance([west, south], [east, south], options); | ||
var cellWidthDeg = xFraction * (east - west); | ||
var yFraction = cellHeight / (distance([west, south], [west, north], options)); | ||
var yFraction = cellHeight / distance([west, south], [west, north], options); | ||
var cellHeightDeg = yFraction * (north - south); | ||
// rows & columns | ||
var bboxWidth = (east - west); | ||
var bboxHeight = (north - south); | ||
var bboxWidth = east - west; | ||
var bboxHeight = north - south; | ||
var columns = Math.floor(bboxWidth / cellWidthDeg); | ||
@@ -55,3 +55,4 @@ var rows = Math.floor(bboxHeight / cellHeightDeg); | ||
for (var row = 0; row < rows; row++) { | ||
var cellPoly = polygon([[ | ||
var cellPoly = polygon([ | ||
[ | ||
[currentX, currentY], | ||
@@ -62,3 +63,4 @@ [currentX, currentY + cellHeightDeg], | ||
[currentX, currentY], | ||
]], options.properties); | ||
], | ||
], options.properties); | ||
if (options.mask) { | ||
@@ -65,0 +67,0 @@ if (intersect(options.mask, cellPoly)) { |
@@ -42,9 +42,9 @@ "use strict"; | ||
var north = bbox[3]; | ||
var xFraction = cellWidth / (distance_1.default([west, south], [east, south], options)); | ||
var xFraction = cellWidth / distance_1.default([west, south], [east, south], options); | ||
var cellWidthDeg = xFraction * (east - west); | ||
var yFraction = cellHeight / (distance_1.default([west, south], [west, north], options)); | ||
var yFraction = cellHeight / distance_1.default([west, south], [west, north], options); | ||
var cellHeightDeg = yFraction * (north - south); | ||
// rows & columns | ||
var bboxWidth = (east - west); | ||
var bboxHeight = (north - south); | ||
var bboxWidth = east - west; | ||
var bboxHeight = north - south; | ||
var columns = Math.floor(bboxWidth / cellWidthDeg); | ||
@@ -60,3 +60,4 @@ var rows = Math.floor(bboxHeight / cellHeightDeg); | ||
for (var row = 0; row < rows; row++) { | ||
var cellPoly = helpers_1.polygon([[ | ||
var cellPoly = helpers_1.polygon([ | ||
[ | ||
[currentX, currentY], | ||
@@ -67,3 +68,4 @@ [currentX, currentY + cellHeightDeg], | ||
[currentX, currentY], | ||
]], options.properties); | ||
], | ||
], options.properties); | ||
if (options.mask) { | ||
@@ -70,0 +72,0 @@ if (boolean_intersects_1.default(options.mask, cellPoly)) { |
{ | ||
"name": "@turf/rectangle-grid", | ||
"version": "6.2.0-alpha.2", | ||
"version": "6.2.0-alpha.3", | ||
"description": "turf rectangle-grid module", | ||
@@ -30,2 +30,6 @@ "author": "Turf Authors", | ||
"module": "dist/es/index.js", | ||
"exports": { | ||
"import": "./dist/es/index.js", | ||
"require": "./dist/js/index.js" | ||
}, | ||
"types": "dist/js/index.d.ts", | ||
@@ -37,14 +41,13 @@ "sideEffects": false, | ||
"scripts": { | ||
"bench": "npm-run-all prepare bench:run", | ||
"bench:run": "node bench.js", | ||
"bench": "ts-node bench.js", | ||
"build": "npm-run-all build:*", | ||
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json", | ||
"build:js": "tsc", | ||
"docs": "node ../../scripts/generate-readmes", | ||
"prepare": "npm-run-all prepare:*", | ||
"prepare:es": "tsc --outDir dist/es --module esnext --declaration false", | ||
"prepare:js": "tsc", | ||
"test": "npm-run-all prepare test:*", | ||
"test:tape": "node -r esm test.js" | ||
"test": "npm-run-all test:*", | ||
"test:tape": "ts-node -r esm test.js" | ||
}, | ||
"devDependencies": { | ||
"@turf/bbox-polygon": "^6.2.0-alpha.2", | ||
"@turf/truncate": "^6.2.0-alpha.2", | ||
"@turf/bbox-polygon": "^6.2.0-alpha.3", | ||
"@turf/truncate": "^6.2.0-alpha.3", | ||
"benchmark": "*", | ||
@@ -55,2 +58,3 @@ "load-json-file": "*", | ||
"tape": "*", | ||
"ts-node": "*", | ||
"typescript": "*", | ||
@@ -60,8 +64,7 @@ "write-json-file": "*" | ||
"dependencies": { | ||
"@turf/boolean-intersects": "^6.2.0-alpha.2", | ||
"@turf/distance": "^6.2.0-alpha.2", | ||
"@turf/helpers": "^6.2.0-alpha.2", | ||
"@turf/invariant": "^6.2.0-alpha.2" | ||
"@turf/boolean-intersects": "^6.2.0-alpha.3", | ||
"@turf/distance": "^6.2.0-alpha.3", | ||
"@turf/helpers": "^6.2.0-alpha.3" | ||
}, | ||
"gitHead": "23d5cb91d77e0c1e2e903a2252f525797f1d0d09" | ||
"gitHead": "dce9edfc705352e8cb9e0083c9330ba0e8d77409" | ||
} |
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
13749
3
7
191
10