Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turf/collect

Package Overview
Dependencies
Maintainers
4
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/collect - npm Package Compare versions

Comparing version 4.7.3 to 5.0.4

main.js

14

index.d.ts

@@ -1,11 +0,11 @@

/// <reference types="geojson" />
import { FeatureCollection, Polygon, Feature, Point } from '@turf/helpers';
type Polygons = GeoJSON.FeatureCollection<GeoJSON.Polygon>;
type Points = GeoJSON.FeatureCollection<GeoJSON.Point>;
/**
* http://turfjs.org/docs/#collect
*/
declare function collect(polygons: Polygons, points: Points, inProperty: string, outProperty: string): Polygons;
declare namespace collect { }
export = collect;
export default function (
polygons: FeatureCollection<Polygon>,
points: FeatureCollection<Point>,
inProperty: string,
outProperty: string
): FeatureCollection<Polygon>;

@@ -1,3 +0,3 @@

var turfbbox = require('@turf/bbox');
var inside = require('@turf/inside');
import turfbbox from '@turf/bbox';
import booleanPointInPolygon from '@turf/boolean-point-in-polygon';
var rbush = require('rbush');

@@ -35,3 +35,3 @@

*/
module.exports = function (polygons, points, inProperty, outProperty) {
function collect(polygons, points, inProperty, outProperty) {
var rtree = rbush(6);

@@ -59,3 +59,3 @@

potentialPoints.forEach(function (pt) {
if (inside({'type': 'Point', 'coordinates': [pt.minX, pt.minY]}, poly)) {
if (booleanPointInPolygon([pt.minX, pt.minY], poly)) {
values.push(pt.property);

@@ -69,2 +69,4 @@ }

return polygons;
};
}
export default collect;
{
"name": "@turf/collect",
"version": "4.7.3",
"version": "5.0.4",
"description": "turf collect module",
"main": "index.js",
"main": "main",
"module": "index",
"jsnext:main": "index",
"types": "index.d.ts",
"files": [
"index.js",
"index.d.ts"
"index.d.ts",
"main.js"
],
"scripts": {
"test": "node test.js",
"bench": "node bench.js"
"pretest": "rollup -c ../../rollup.config.js",
"test": "node -r @std/esm test.js",
"bench": "node -r @std/esm bench.js"
},

@@ -19,5 +23,2 @@ "repository": {

},
"bugs": {
"url": "https://github.com/Turfjs/turf/issues"
},
"keywords": [

@@ -31,3 +32,2 @@ "aggregate",

],
"homepage": "https://github.com/Turfjs/turf",
"author": "Turf Authors",

@@ -38,12 +38,22 @@ "contributors": [

"license": "MIT",
"bugs": {
"url": "https://github.com/Turfjs/turf/issues"
},
"homepage": "https://github.com/Turfjs/turf",
"devDependencies": {
"@turf/helpers": "^4.7.3",
"benchmark": "^2.1.4",
"tape": "^4.6.3"
"@std/esm": "*",
"benchmark": "*",
"rollup": "*",
"tape": "*"
},
"dependencies": {
"@turf/bbox": "^4.7.3",
"@turf/inside": "^4.7.3",
"@turf/bbox": "^5.0.4",
"@turf/boolean-point-in-polygon": "^5.0.4",
"@turf/helpers": "^5.0.4",
"rbush": "^2.0.1"
},
"@std/esm": {
"esm": "js",
"cjs": true
}
}
# @turf/collect
# collect
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## collect
Merges a specified property from a FeatureCollection of points into a

@@ -6,0 +8,0 @@ FeatureCollection of polygons. Given an `inProperty` on points and an `outProperty`

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