7.2.0 • Published 11 months ago
@turf/distance-weight v7.2.0
@turf/distance-weight
pNormDistance
calcualte the Minkowski p-norm distance between two features.
Parameters
feature1point featurefeature2point featurepp-norm 1=<p<=infinity 1: Manhattan distance 2: Euclidean distance
distanceWeight
Parameters
fcFeatureCollection<any> FeatureCollection.optionsObject? option object.options.thresholdnumber If the distance between neighbor and target features is greater than threshold, the weight of that neighbor is 0. (optional, default10000)options.pnumber Minkowski p-norm distance parameter. 1: Manhattan distance. 2: Euclidean distance. 1=<p<=infinity. (optional, default2)options.binaryboolean If true, weight=1 if d <= threshold otherwise weight=0. If false, weight=Math.pow(d, alpha). (optional, defaultfalse)options.alphanumber distance decay parameter. A big value means the weight decay quickly as distance increases. (optional, default-1)options.standardizationboolean row standardization. (optional, defaultfalse)
Examples
var bbox = [-65, 40, -63, 42];
var dataset = turf.randomPoint(100, { bbox: bbox });
var result = turf.distanceWeight(dataset);Returns Array<Array<number>> distance weight matrix.
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Installation
Install this module individually:
$ npm install @turf/distance-weightOr install the Turf module that includes it as a function:
$ npm install @turf/turf7.2.0
11 months ago
7.1.0
1 year ago
7.1.0-alpha.70
1 year ago
7.0.0
1 year ago
7.1.0-alpha.7
1 year ago
7.0.0-alpha.116
2 years ago
7.0.0-alpha.115
2 years ago
7.0.0-alpha.114
2 years ago
7.0.0-alpha.113
2 years ago
7.0.0-alpha.111
2 years ago
7.0.0-alpha.110
2 years ago
7.0.0-alpha.1
2 years ago
7.0.0-alpha.2
2 years ago
7.0.0-alpha.0
3 years ago
6.5.0
4 years ago
6.4.0
4 years ago
6.3.0
5 years ago
6.2.0
5 years ago
6.2.0-alpha.3
5 years ago
6.2.0-alpha.2
5 years ago
6.2.0-alpha.1
6 years ago
6.2.0-alpha.0
6 years ago
6.0.1
8 years ago
6.0.0
8 years ago