New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@turf/point-grid

Package Overview
Dependencies
Maintainers
7
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/point-grid - npm Package Compare versions

Comparing version 6.5.0 to 7.0.0-alpha.0

5

dist/es/index.js
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>;

13

dist/js/index.js
"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]&lt;[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]&lt;([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]&lt;[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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc