@turf/point-grid
Advanced tools
Comparing version 6.5.0 to 7.0.0-alpha.0
import within from "@turf/boolean-within"; | ||
import distance from "@turf/distance"; | ||
import { point, featureCollection, } from "@turf/helpers"; | ||
import { point, featureCollection } from "@turf/helpers"; | ||
/** | ||
@@ -25,4 +25,3 @@ * Creates a {@link Point} grid from a bounding box, {@link FeatureCollection} or {@link Feature}. | ||
*/ | ||
function pointGrid(bbox, cellSide, options) { | ||
if (options === void 0) { options = {}; } | ||
function pointGrid(bbox, cellSide, options = {}) { | ||
// Default parameters | ||
@@ -29,0 +28,0 @@ if (options.mask && !options.units) |
@@ -1,2 +0,3 @@ | ||
import { BBox, Feature, Polygon, MultiPolygon, FeatureCollection, Point, Properties, Units } from "@turf/helpers"; | ||
import { BBox, Feature, Polygon, MultiPolygon, FeatureCollection, Point, GeoJsonProperties } from "geojson"; | ||
import { Units } from "@turf/helpers"; | ||
/** | ||
@@ -23,3 +24,3 @@ * Creates a {@link Point} grid from a bounding box, {@link FeatureCollection} or {@link Feature}. | ||
*/ | ||
declare function pointGrid<P = Properties>(bbox: BBox, cellSide: number, options?: { | ||
declare function pointGrid<P = GeoJsonProperties>(bbox: BBox, cellSide: number, options?: { | ||
units?: Units; | ||
@@ -26,0 +27,0 @@ mask?: Feature<Polygon | MultiPolygon>; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var boolean_within_1 = __importDefault(require("@turf/boolean-within")); | ||
var distance_1 = __importDefault(require("@turf/distance")); | ||
var helpers_1 = require("@turf/helpers"); | ||
const tslib_1 = require("tslib"); | ||
const boolean_within_1 = tslib_1.__importDefault(require("@turf/boolean-within")); | ||
const distance_1 = tslib_1.__importDefault(require("@turf/distance")); | ||
const helpers_1 = require("@turf/helpers"); | ||
/** | ||
@@ -30,4 +28,3 @@ * Creates a {@link Point} grid from a bounding box, {@link FeatureCollection} or {@link Feature}. | ||
*/ | ||
function pointGrid(bbox, cellSide, options) { | ||
if (options === void 0) { options = {}; } | ||
function pointGrid(bbox, cellSide, options = {}) { | ||
// Default parameters | ||
@@ -34,0 +31,0 @@ if (options.mask && !options.units) |
{ | ||
"name": "@turf/point-grid", | ||
"version": "6.5.0", | ||
"version": "7.0.0-alpha.0", | ||
"description": "turf point-grid module", | ||
@@ -51,7 +51,7 @@ "author": "Turf Authors", | ||
"test:tape": "ts-node -r esm test.js", | ||
"test:types": "tsc --esModuleInterop --noEmit types.ts" | ||
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts" | ||
}, | ||
"devDependencies": { | ||
"@turf/bbox-polygon": "^6.5.0", | ||
"@turf/truncate": "^6.5.0", | ||
"@turf/bbox-polygon": "^7.0.0-alpha.0", | ||
"@turf/truncate": "^7.0.0-alpha.0", | ||
"@types/tape": "*", | ||
@@ -68,8 +68,9 @@ "benchmark": "*", | ||
"dependencies": { | ||
"@turf/boolean-within": "^6.5.0", | ||
"@turf/distance": "^6.5.0", | ||
"@turf/helpers": "^6.5.0", | ||
"@turf/invariant": "^6.5.0" | ||
"@turf/boolean-within": "^7.0.0-alpha.0", | ||
"@turf/distance": "^7.0.0-alpha.0", | ||
"@turf/helpers": "^7.0.0-alpha.0", | ||
"@turf/invariant": "^7.0.0-alpha.0", | ||
"tslib": "^2.3.0" | ||
}, | ||
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e" | ||
"gitHead": "0edc4c491b999e5ace770a61e1cf549f7c004189" | ||
} |
@@ -9,13 +9,14 @@ # @turf/point-grid | ||
**Parameters** | ||
### Parameters | ||
- `bbox` **[Array][4]<[number][5]>** extent in [minX, minY, maxX, maxY] order | ||
- `cellSide` **[number][5]** the distance between points, in units | ||
- `options` **[Object][6]** Optional parameters (optional, default `{}`) | ||
- `options.units` **[string][7]** used in calculating cellSide, can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`) | ||
- `options.mask` **[Feature][8]<([Polygon][9] \| [MultiPolygon][10])>?** if passed a Polygon or MultiPolygon, the grid Points will be created only inside it | ||
- `options.properties` **[Object][6]** passed to each point of the grid (optional, default `{}`) | ||
* `bbox` **[Array][4]<[number][5]>** extent in \[minX, minY, maxX, maxY] order | ||
* `cellSide` **[number][5]** the distance between points, in units | ||
* `options` **[Object][6]** Optional parameters (optional, default `{}`) | ||
**Examples** | ||
* `options.units` **[string][7]** used in calculating cellSide, can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`) | ||
* `options.mask` **[Feature][8]<([Polygon][9] | [MultiPolygon][10])>?** if passed a Polygon or MultiPolygon, the grid Points will be created only inside it | ||
* `options.properties` **[Object][6]** passed to each point of the grid (optional, default `{}`) | ||
### Examples | ||
```javascript | ||
@@ -32,3 +33,3 @@ var extent = [-70.823364, -33.553984, -70.473175, -33.302986]; | ||
Returns **[FeatureCollection][11]<[Point][12]>** grid of points | ||
Returns **[FeatureCollection][11]<[Point][12]>** grid of points | ||
@@ -35,0 +36,0 @@ [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
82
13402
5
174
1
+ Addedtslib@^2.3.0
+ Added@turf/bbox@7.2.0(transitive)
+ Added@turf/boolean-point-in-polygon@7.2.0(transitive)
+ Added@turf/boolean-point-on-line@7.2.0(transitive)
+ Added@turf/boolean-within@7.2.0(transitive)
+ Added@turf/distance@7.2.0(transitive)
+ Added@turf/helpers@7.2.0(transitive)
+ Added@turf/invariant@7.2.0(transitive)
+ Added@turf/meta@7.2.0(transitive)
+ Added@types/geojson@7946.0.16(transitive)
+ Addedpoint-in-polygon-hao@1.2.4(transitive)
+ Addedrobust-predicates@3.0.2(transitive)
+ Addedtslib@2.8.1(transitive)
- Removed@turf/bbox@6.5.0(transitive)
- Removed@turf/boolean-point-in-polygon@6.5.0(transitive)
- Removed@turf/boolean-point-on-line@6.5.0(transitive)
- Removed@turf/boolean-within@6.5.0(transitive)
- Removed@turf/distance@6.5.0(transitive)
- Removed@turf/helpers@6.5.0(transitive)
- Removed@turf/invariant@6.5.0(transitive)
- Removed@turf/meta@6.5.0(transitive)
Updated@turf/helpers@^7.0.0-alpha.0