@turf/point-on-feature
Advanced tools
Comparing version 6.4.0 to 6.5.0
@@ -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" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
14095
298
0
Updated@turf/center@^6.5.0
Updated@turf/explode@^6.5.0
Updated@turf/helpers@^6.5.0
Updated@turf/nearest-point@^6.5.0