@turf/point-grid
Advanced tools
Comparing version 6.2.0-alpha.2 to 6.2.0-alpha.3
@@ -1,4 +0,4 @@ | ||
import within from '@turf/boolean-within'; | ||
import distance from '@turf/distance'; | ||
import { point, featureCollection } from '@turf/helpers'; | ||
import within from "@turf/boolean-within"; | ||
import distance from "@turf/distance"; | ||
import { point, featureCollection, } from "@turf/helpers"; | ||
/** | ||
@@ -29,3 +29,3 @@ * Creates a {@link Point} grid from a bounding box, {@link FeatureCollection} or {@link Feature}. | ||
if (options.mask && !options.units) | ||
options.units = 'kilometers'; | ||
options.units = "kilometers"; | ||
// Containers | ||
@@ -44,8 +44,8 @@ var results = []; | ||
var north = bbox[3]; | ||
var xFraction = cellSide / (distance([west, south], [east, south], options)); | ||
var xFraction = cellSide / distance([west, south], [east, south], options); | ||
var cellWidth = xFraction * (east - west); | ||
var yFraction = cellSide / (distance([west, south], [west, north], options)); | ||
var yFraction = cellSide / distance([west, south], [west, north], options); | ||
var cellHeight = yFraction * (north - south); | ||
var bboxWidth = (east - west); | ||
var bboxHeight = (north - south); | ||
var bboxWidth = east - west; | ||
var bboxHeight = north - south; | ||
var columns = Math.floor(bboxWidth / cellWidth); | ||
@@ -52,0 +52,0 @@ var rows = Math.floor(bboxHeight / cellHeight); |
@@ -1,2 +0,2 @@ | ||
import { BBox, Feature, Polygon, MultiPolygon, FeatureCollection, Point, Properties, Units } from '@turf/helpers'; | ||
import { BBox, Feature, Polygon, MultiPolygon, FeatureCollection, Point, Properties, Units } from "@turf/helpers"; | ||
/** | ||
@@ -3,0 +3,0 @@ * Creates a {@link Point} grid from a bounding box, {@link FeatureCollection} or {@link Feature}. |
@@ -34,3 +34,3 @@ "use strict"; | ||
if (options.mask && !options.units) | ||
options.units = 'kilometers'; | ||
options.units = "kilometers"; | ||
// Containers | ||
@@ -49,8 +49,8 @@ var results = []; | ||
var north = bbox[3]; | ||
var xFraction = cellSide / (distance_1.default([west, south], [east, south], options)); | ||
var xFraction = cellSide / distance_1.default([west, south], [east, south], options); | ||
var cellWidth = xFraction * (east - west); | ||
var yFraction = cellSide / (distance_1.default([west, south], [west, north], options)); | ||
var yFraction = cellSide / distance_1.default([west, south], [west, north], options); | ||
var cellHeight = yFraction * (north - south); | ||
var bboxWidth = (east - west); | ||
var bboxHeight = (north - south); | ||
var bboxWidth = east - west; | ||
var bboxHeight = north - south; | ||
var columns = Math.floor(bboxWidth / cellWidth); | ||
@@ -57,0 +57,0 @@ var rows = Math.floor(bboxHeight / cellHeight); |
{ | ||
"name": "@turf/point-grid", | ||
"version": "6.2.0-alpha.2", | ||
"version": "6.2.0-alpha.3", | ||
"description": "turf point-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,15 +41,14 @@ "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:types": "tsc --noEmit types.ts" | ||
"test": "npm-run-all test:*", | ||
"test:tape": "ts-node -r esm test.js", | ||
"test:types": "tsc --esModuleInterop --noEmit types.ts" | ||
}, | ||
"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", | ||
"@types/tape": "*", | ||
@@ -56,2 +59,3 @@ "benchmark": "*", | ||
"tape": "*", | ||
"ts-node": "*", | ||
"tslint": "*", | ||
@@ -62,8 +66,8 @@ "typescript": "*", | ||
"dependencies": { | ||
"@turf/boolean-within": "^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-within": "^6.2.0-alpha.3", | ||
"@turf/distance": "^6.2.0-alpha.3", | ||
"@turf/helpers": "^6.2.0-alpha.3", | ||
"@turf/invariant": "^6.2.0-alpha.3" | ||
}, | ||
"gitHead": "23d5cb91d77e0c1e2e903a2252f525797f1d0d09" | ||
"gitHead": "dce9edfc705352e8cb9e0083c9330ba0e8d77409" | ||
} |
13395
7
11