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

@turf/point-on-feature

Package Overview
Dependencies
Maintainers
6
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/point-on-feature - npm Package Compare versions

Comparing version 6.4.0 to 6.5.0

2

dist/es/index.js

@@ -5,3 +5,3 @@ import explode from '@turf/explode';

import booleanPointInPolygon from '@turf/boolean-point-in-polygon';
import { featureCollection, feature, point } from '@turf/helpers';
import { featureCollection, point, feature } from '@turf/helpers';

@@ -8,0 +8,0 @@ /**

'use strict';
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var explode = _interopDefault(require('@turf/explode'));
var centroid = _interopDefault(require('@turf/center'));
var nearestPoint = _interopDefault(require('@turf/nearest-point'));
var booleanPointInPolygon = _interopDefault(require('@turf/boolean-point-in-polygon'));
var explode = require('@turf/explode');
var centroid = require('@turf/center');
var nearestPoint = require('@turf/nearest-point');
var booleanPointInPolygon = require('@turf/boolean-point-in-polygon');
var helpers = require('@turf/helpers');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var explode__default = /*#__PURE__*/_interopDefaultLegacy(explode);
var centroid__default = /*#__PURE__*/_interopDefaultLegacy(centroid);
var nearestPoint__default = /*#__PURE__*/_interopDefaultLegacy(nearestPoint);
var booleanPointInPolygon__default = /*#__PURE__*/_interopDefaultLegacy(booleanPointInPolygon);
/**

@@ -42,3 +47,3 @@ * Takes a Feature or FeatureCollection and returns a {@link Point} guaranteed to be on the surface of the feature.

// get centroid
var cent = centroid(fc);
var cent = centroid__default['default'](fc);

@@ -109,3 +114,3 @@ // check to see if centroid is on surface

} else if (geom.type === "Polygon" || geom.type === "MultiPolygon") {
if (booleanPointInPolygon(cent, geom)) {
if (booleanPointInPolygon__default['default'](cent, geom)) {
onSurface = true;

@@ -122,7 +127,7 @@ }

vertices.features = vertices.features.concat(
explode(fc.features[i]).features
explode__default['default'](fc.features[i]).features
);
}
// Remove distanceToPoint properties from nearestPoint()
return helpers.point(nearestPoint(cent, vertices).geometry.coordinates);
return helpers.point(nearestPoint__default['default'](cent, vertices).geometry.coordinates);
}

@@ -157,1 +162,2 @@ }

module.exports = pointOnFeature;
module.exports.default = pointOnFeature;
{
"name": "@turf/point-on-feature",
"version": "6.4.0",
"version": "6.5.0",
"description": "turf point-on-feature module",

@@ -15,2 +15,3 @@ "author": "Turf Authors",

},
"funding": "https://opencollective.com/turf",
"publishConfig": {

@@ -50,4 +51,4 @@ "access": "public"

"devDependencies": {
"@turf/meta": "^6.4.0",
"@turf/truncate": "^6.4.0",
"@turf/meta": "^6.5.0",
"@turf/truncate": "^6.5.0",
"benchmark": "*",

@@ -59,9 +60,9 @@ "npm-run-all": "*",

"dependencies": {
"@turf/boolean-point-in-polygon": "^6.4.0",
"@turf/center": "^6.4.0",
"@turf/explode": "^6.4.0",
"@turf/helpers": "^6.4.0",
"@turf/nearest-point": "^6.4.0"
"@turf/boolean-point-in-polygon": "^6.5.0",
"@turf/center": "^6.5.0",
"@turf/explode": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/nearest-point": "^6.5.0"
},
"gitHead": "1e62773cfc88c627cca8effcb5c14cfb65a905ac"
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}
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