@turf/meta
Advanced tools
Comparing version 6.0.1 to 6.0.2
@@ -80,3 +80,3 @@ import { | ||
*/ | ||
export function featureEach<G extends Geometries, P = Properties>( | ||
export function featureEach<G extends any, P = Properties>( | ||
geojson: Feature<G, P> | FeatureCollection<G, P> | Feature<GeometryCollection, P>, | ||
@@ -83,0 +83,0 @@ callback: (currentFeature: Feature<G, P>, |
33
index.js
@@ -115,3 +115,3 @@ 'use strict'; | ||
for (j = 0; j < coords.length; j++) { | ||
if (geomType === 'MultiPolygon') geometryIndex = 0; | ||
geometryIndex = 0; | ||
for (k = 0; k < coords[j].length; k++) { | ||
@@ -720,9 +720,9 @@ for (l = 0; l < coords[j][k].length - wrapShrink; l++) { | ||
function segmentEach(geojson, callback) { | ||
flattenEach(geojson, function (feature$$1, featureIndex, multiFeatureIndex) { | ||
flattenEach(geojson, function (feature, featureIndex, multiFeatureIndex) { | ||
var segmentIndex = 0; | ||
// Exclude null Geometries | ||
if (!feature$$1.geometry) return; | ||
if (!feature.geometry) return; | ||
// (Multi)Point geometries do not contain segments therefore they are ignored during this operation. | ||
var type = feature$$1.geometry.type; | ||
var type = feature.geometry.type; | ||
if (type === 'Point' || type === 'MultiPoint') return; | ||
@@ -732,9 +732,16 @@ | ||
var previousCoords; | ||
if (coordEach(feature$$1, function (currentCoord, coordIndex, featureIndexCoord, mutliPartIndexCoord, geometryIndex) { | ||
var previousFeatureIndex = 0; | ||
var previousMultiIndex = 0; | ||
var prevGeomIndex = 0; | ||
if (coordEach(feature, function (currentCoord, coordIndex, featureIndexCoord, multiPartIndexCoord, geometryIndex) { | ||
// Simulating a meta.coordReduce() since `reduce` operations cannot be stopped by returning `false` | ||
if (previousCoords === undefined) { | ||
if (previousCoords === undefined || featureIndex > previousFeatureIndex || multiPartIndexCoord > previousMultiIndex || geometryIndex > prevGeomIndex) { | ||
previousCoords = currentCoord; | ||
previousFeatureIndex = featureIndex; | ||
previousMultiIndex = multiPartIndexCoord; | ||
prevGeomIndex = geometryIndex; | ||
segmentIndex = 0; | ||
return; | ||
} | ||
var currentSegment = helpers.lineString([previousCoords, currentCoord], feature$$1.properties); | ||
var currentSegment = helpers.lineString([previousCoords, currentCoord], feature.properties); | ||
if (callback(currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) === false) return false; | ||
@@ -845,13 +852,13 @@ segmentIndex++; | ||
flattenEach(geojson, function (feature$$1, featureIndex, multiFeatureIndex) { | ||
if (feature$$1.geometry === null) return; | ||
var type = feature$$1.geometry.type; | ||
var coords = feature$$1.geometry.coordinates; | ||
flattenEach(geojson, function (feature, featureIndex, multiFeatureIndex) { | ||
if (feature.geometry === null) return; | ||
var type = feature.geometry.type; | ||
var coords = feature.geometry.coordinates; | ||
switch (type) { | ||
case 'LineString': | ||
if (callback(feature$$1, featureIndex, multiFeatureIndex, 0, 0) === false) return false; | ||
if (callback(feature, featureIndex, multiFeatureIndex, 0, 0) === false) return false; | ||
break; | ||
case 'Polygon': | ||
for (var geometryIndex = 0; geometryIndex < coords.length; geometryIndex++) { | ||
if (callback(helpers.lineString(coords[geometryIndex], feature$$1.properties), featureIndex, multiFeatureIndex, geometryIndex) === false) return false; | ||
if (callback(helpers.lineString(coords[geometryIndex], feature.properties), featureIndex, multiFeatureIndex, geometryIndex) === false) return false; | ||
} | ||
@@ -858,0 +865,0 @@ break; |
{ | ||
"name": "@turf/meta", | ||
"version": "6.0.1", | ||
"version": "6.0.2", | ||
"description": "turf meta module", | ||
"main": "index", | ||
"module": "index.mjs", | ||
"types": "index.d.ts", | ||
"files": [ | ||
"index.js", | ||
"index.mjs", | ||
"index.d.ts" | ||
@@ -12,0 +10,0 @@ ], |
264
README.md
@@ -9,11 +9,11 @@ # @turf/meta | ||
Type: [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) | ||
Type: [Function][1] | ||
**Parameters** | ||
- `currentCoord` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** The current coordinate being processed. | ||
- `coordIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the coordinate being processed. | ||
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Feature being processed. | ||
- `multiFeatureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Multi-Feature being processed. | ||
- `geometryIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Geometry being processed. | ||
- `currentCoord` **[Array][2]<[number][3]>** The current coordinate being processed. | ||
- `coordIndex` **[number][3]** The current index of the coordinate being processed. | ||
- `featureIndex` **[number][3]** The current index of the Feature being processed. | ||
- `multiFeatureIndex` **[number][3]** The current index of the Multi-Feature being processed. | ||
- `geometryIndex` **[number][3]** The current index of the Geometry being processed. | ||
@@ -26,5 +26,5 @@ ## coordEach | ||
- `geojson` **([FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2) \| [Geometry](https://tools.ietf.org/html/rfc7946#section-3.1))** any GeoJSON object | ||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (currentCoord, coordIndex, featureIndex, multiFeatureIndex) | ||
- `excludeWrapCoord` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. (optional, default `false`) | ||
- `geojson` **([FeatureCollection][4] \| [Feature][5] \| [Geometry][6])** any GeoJSON object | ||
- `callback` **[Function][1]** a method that takes (currentCoord, coordIndex, featureIndex, multiFeatureIndex) | ||
- `excludeWrapCoord` **[boolean][7]** whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. (optional, default `false`) | ||
@@ -56,6 +56,6 @@ **Examples** | ||
- `geojson` **([FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) \| [Geometry](https://tools.ietf.org/html/rfc7946#section-3.1) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2))** any GeoJSON object | ||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (previousValue, currentCoord, coordIndex) | ||
- `geojson` **([FeatureCollection][4] \| [Geometry][6] \| [Feature][5])** any GeoJSON object | ||
- `callback` **[Function][1]** a method that takes (previousValue, currentCoord, coordIndex) | ||
- `initialValue` **any?** Value to use as the first argument to the first call of the callback. | ||
- `excludeWrapCoord` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. (optional, default `false`) | ||
- `excludeWrapCoord` **[boolean][7]** whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. (optional, default `false`) | ||
@@ -100,3 +100,3 @@ **Examples** | ||
Type: [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) | ||
Type: [Function][1] | ||
@@ -107,8 +107,8 @@ **Parameters** | ||
of the callback, or initialValue, if supplied. | ||
- `currentCoord` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** The current coordinate being processed. | ||
- `coordIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the coordinate being processed. | ||
- `currentCoord` **[Array][2]<[number][3]>** The current coordinate being processed. | ||
- `coordIndex` **[number][3]** The current index of the coordinate being processed. | ||
Starts at index 0, if an initialValue is provided, and at index 1 otherwise. | ||
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Feature being processed. | ||
- `multiFeatureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Multi-Feature being processed. | ||
- `geometryIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Geometry being processed. | ||
- `featureIndex` **[number][3]** The current index of the Feature being processed. | ||
- `multiFeatureIndex` **[number][3]** The current index of the Multi-Feature being processed. | ||
- `geometryIndex` **[number][3]** The current index of the Geometry being processed. | ||
@@ -121,4 +121,4 @@ ## propEach | ||
- `geojson` **([FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2))** any GeoJSON object | ||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (currentProperties, featureIndex) | ||
- `geojson` **([FeatureCollection][4] \| [Feature][5])** any GeoJSON object | ||
- `callback` **[Function][1]** a method that takes (currentProperties, featureIndex) | ||
@@ -145,8 +145,8 @@ **Examples** | ||
Type: [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) | ||
Type: [Function][1] | ||
**Parameters** | ||
- `currentProperties` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The current Properties being processed. | ||
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Feature being processed. | ||
- `currentProperties` **[Object][8]** The current Properties being processed. | ||
- `featureIndex` **[number][3]** The current index of the Feature being processed. | ||
@@ -170,3 +170,3 @@ ## propReduceCallback | ||
Type: [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) | ||
Type: [Function][1] | ||
@@ -178,3 +178,3 @@ **Parameters** | ||
- `currentProperties` **any** The current Properties being processed. | ||
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Feature being processed. | ||
- `featureIndex` **[number][3]** The current index of the Feature being processed. | ||
@@ -189,4 +189,4 @@ ## propReduce | ||
- `geojson` **([FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2))** any GeoJSON object | ||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (previousValue, currentProperties, featureIndex) | ||
- `geojson` **([FeatureCollection][4] \| [Feature][5])** any GeoJSON object | ||
- `callback` **[Function][1]** a method that takes (previousValue, currentProperties, featureIndex) | ||
- `initialValue` **any?** Value to use as the first argument to the first call of the callback. | ||
@@ -216,8 +216,8 @@ | ||
Type: [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) | ||
Type: [Function][1] | ||
**Parameters** | ||
- `currentFeature` **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)<any>** The current Feature being processed. | ||
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Feature being processed. | ||
- `currentFeature` **[Feature][5]<any>** The current Feature being processed. | ||
- `featureIndex` **[number][3]** The current index of the Feature being processed. | ||
@@ -231,4 +231,4 @@ ## featureEach | ||
- `geojson` **([FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2) \| [Geometry](https://tools.ietf.org/html/rfc7946#section-3.1))** any GeoJSON object | ||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (currentFeature, featureIndex) | ||
- `geojson` **([FeatureCollection][4] \| [Feature][5] \| [Geometry][6])** any GeoJSON object | ||
- `callback` **[Function][1]** a method that takes (currentFeature, featureIndex) | ||
@@ -268,3 +268,3 @@ **Examples** | ||
Type: [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) | ||
Type: [Function][1] | ||
@@ -275,4 +275,4 @@ **Parameters** | ||
of the callback, or initialValue, if supplied. | ||
- `currentFeature` **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)** The current Feature being processed. | ||
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Feature being processed. | ||
- `currentFeature` **[Feature][5]** The current Feature being processed. | ||
- `featureIndex` **[number][3]** The current index of the Feature being processed. | ||
@@ -285,4 +285,4 @@ ## featureReduce | ||
- `geojson` **([FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2) \| [Geometry](https://tools.ietf.org/html/rfc7946#section-3.1))** any GeoJSON object | ||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (previousValue, currentFeature, featureIndex) | ||
- `geojson` **([FeatureCollection][4] \| [Feature][5] \| [Geometry][6])** any GeoJSON object | ||
- `callback` **[Function][1]** a method that takes (previousValue, currentFeature, featureIndex) | ||
- `initialValue` **any?** Value to use as the first argument to the first call of the callback. | ||
@@ -314,3 +314,3 @@ | ||
- `geojson` **([FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2) \| [Geometry](https://tools.ietf.org/html/rfc7946#section-3.1))** any GeoJSON object | ||
- `geojson` **([FeatureCollection][4] \| [Feature][5] \| [Geometry][6])** any GeoJSON object | ||
@@ -329,3 +329,3 @@ **Examples** | ||
Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>>** coordinate position array | ||
Returns **[Array][2]<[Array][2]<[number][3]>>** coordinate position array | ||
@@ -336,11 +336,11 @@ ## geomEachCallback | ||
Type: [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) | ||
Type: [Function][1] | ||
**Parameters** | ||
- `currentGeometry` **[Geometry](https://tools.ietf.org/html/rfc7946#section-3.1)** The current Geometry being processed. | ||
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Feature being processed. | ||
- `featureProperties` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The current Feature Properties being processed. | ||
- `featureBBox` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** The current Feature BBox being processed. | ||
- `featureId` **([number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) \| [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** The current Feature Id being processed. | ||
- `currentGeometry` **[Geometry][6]** The current Geometry being processed. | ||
- `featureIndex` **[number][3]** The current index of the Feature being processed. | ||
- `featureProperties` **[Object][8]** The current Feature Properties being processed. | ||
- `featureBBox` **[Array][2]<[number][3]>** The current Feature BBox being processed. | ||
- `featureId` **([number][3] \| [string][9])** The current Feature Id being processed. | ||
@@ -353,4 +353,4 @@ ## geomEach | ||
- `geojson` **([FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2) \| [Geometry](https://tools.ietf.org/html/rfc7946#section-3.1))** any GeoJSON object | ||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (currentGeometry, featureIndex, featureProperties, featureBBox, featureId) | ||
- `geojson` **([FeatureCollection][4] \| [Feature][5] \| [Geometry][6])** any GeoJSON object | ||
- `callback` **[Function][1]** a method that takes (currentGeometry, featureIndex, featureProperties, featureBBox, featureId) | ||
@@ -393,3 +393,3 @@ **Examples** | ||
Type: [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) | ||
Type: [Function][1] | ||
@@ -400,7 +400,7 @@ **Parameters** | ||
of the callback, or initialValue, if supplied. | ||
- `currentGeometry` **[Geometry](https://tools.ietf.org/html/rfc7946#section-3.1)** The current Geometry being processed. | ||
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Feature being processed. | ||
- `featureProperties` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The current Feature Properties being processed. | ||
- `featureBBox` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** The current Feature BBox being processed. | ||
- `featureId` **([number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) \| [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** The current Feature Id being processed. | ||
- `currentGeometry` **[Geometry][6]** The current Geometry being processed. | ||
- `featureIndex` **[number][3]** The current index of the Feature being processed. | ||
- `featureProperties` **[Object][8]** The current Feature Properties being processed. | ||
- `featureBBox` **[Array][2]<[number][3]>** The current Feature BBox being processed. | ||
- `featureId` **([number][3] \| [string][9])** The current Feature Id being processed. | ||
@@ -413,4 +413,4 @@ ## geomReduce | ||
- `geojson` **([FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2) \| [Geometry](https://tools.ietf.org/html/rfc7946#section-3.1))** any GeoJSON object | ||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (previousValue, currentGeometry, featureIndex, featureProperties, featureBBox, featureId) | ||
- `geojson` **([FeatureCollection][4] \| [Feature][5] \| [Geometry][6])** any GeoJSON object | ||
- `callback` **[Function][1]** a method that takes (previousValue, currentGeometry, featureIndex, featureProperties, featureBBox, featureId) | ||
- `initialValue` **any?** Value to use as the first argument to the first call of the callback. | ||
@@ -443,9 +443,9 @@ | ||
Type: [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) | ||
Type: [Function][1] | ||
**Parameters** | ||
- `currentFeature` **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)** The current flattened feature being processed. | ||
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Feature being processed. | ||
- `multiFeatureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Multi-Feature being processed. | ||
- `currentFeature` **[Feature][5]** The current flattened feature being processed. | ||
- `featureIndex` **[number][3]** The current index of the Feature being processed. | ||
- `multiFeatureIndex` **[number][3]** The current index of the Multi-Feature being processed. | ||
@@ -459,4 +459,4 @@ ## flattenEach | ||
- `geojson` **([FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2) \| [Geometry](https://tools.ietf.org/html/rfc7946#section-3.1))** any GeoJSON object | ||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (currentFeature, featureIndex, multiFeatureIndex) | ||
- `geojson` **([FeatureCollection][4] \| [Feature][5] \| [Geometry][6])** any GeoJSON object | ||
- `callback` **[Function][1]** a method that takes (currentFeature, featureIndex, multiFeatureIndex) | ||
@@ -495,3 +495,3 @@ **Examples** | ||
Type: [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) | ||
Type: [Function][1] | ||
@@ -502,5 +502,5 @@ **Parameters** | ||
of the callback, or initialValue, if supplied. | ||
- `currentFeature` **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)** The current Feature being processed. | ||
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Feature being processed. | ||
- `multiFeatureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Multi-Feature being processed. | ||
- `currentFeature` **[Feature][5]** The current Feature being processed. | ||
- `featureIndex` **[number][3]** The current index of the Feature being processed. | ||
- `multiFeatureIndex` **[number][3]** The current index of the Multi-Feature being processed. | ||
@@ -513,4 +513,4 @@ ## flattenReduce | ||
- `geojson` **([FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2) \| [Geometry](https://tools.ietf.org/html/rfc7946#section-3.1))** any GeoJSON object | ||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (previousValue, currentFeature, featureIndex, multiFeatureIndex) | ||
- `geojson` **([FeatureCollection][4] \| [Feature][5] \| [Geometry][6])** any GeoJSON object | ||
- `callback` **[Function][1]** a method that takes (previousValue, currentFeature, featureIndex, multiFeatureIndex) | ||
- `initialValue` **any?** Value to use as the first argument to the first call of the callback. | ||
@@ -541,11 +541,11 @@ | ||
Type: [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) | ||
Type: [Function][1] | ||
**Parameters** | ||
- `currentSegment` **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)<[LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4)>** The current Segment being processed. | ||
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Feature being processed. | ||
- `multiFeatureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Multi-Feature being processed. | ||
- `geometryIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Geometry being processed. | ||
- `segmentIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Segment being processed. | ||
- `currentSegment` **[Feature][5]<[LineString][10]>** The current Segment being processed. | ||
- `featureIndex` **[number][3]** The current index of the Feature being processed. | ||
- `multiFeatureIndex` **[number][3]** The current index of the Multi-Feature being processed. | ||
- `geometryIndex` **[number][3]** The current index of the Geometry being processed. | ||
- `segmentIndex` **[number][3]** The current index of the Segment being processed. | ||
@@ -561,4 +561,4 @@ Returns **void** | ||
- `geojson` **([FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2) \| [Geometry](https://tools.ietf.org/html/rfc7946#section-3.1))** any GeoJSON | ||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) | ||
- `geojson` **([FeatureCollection][4] \| [Feature][5] \| [Geometry][6])** any GeoJSON | ||
- `callback` **[Function][1]** a method that takes (currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) | ||
@@ -605,3 +605,3 @@ **Examples** | ||
Type: [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) | ||
Type: [Function][1] | ||
@@ -612,7 +612,7 @@ **Parameters** | ||
of the callback, or initialValue, if supplied. | ||
- `currentSegment` **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)<[LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4)>** The current Segment being processed. | ||
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Feature being processed. | ||
- `multiFeatureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Multi-Feature being processed. | ||
- `geometryIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Geometry being processed. | ||
- `segmentIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Segment being processed. | ||
- `currentSegment` **[Feature][5]<[LineString][10]>** The current Segment being processed. | ||
- `featureIndex` **[number][3]** The current index of the Feature being processed. | ||
- `multiFeatureIndex` **[number][3]** The current index of the Multi-Feature being processed. | ||
- `geometryIndex` **[number][3]** The current index of the Geometry being processed. | ||
- `segmentIndex` **[number][3]** The current index of the Segment being processed. | ||
@@ -626,4 +626,4 @@ ## segmentReduce | ||
- `geojson` **([FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2) \| [Geometry](https://tools.ietf.org/html/rfc7946#section-3.1))** any GeoJSON | ||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (previousValue, currentSegment, currentIndex) | ||
- `geojson` **([FeatureCollection][4] \| [Feature][5] \| [Geometry][6])** any GeoJSON | ||
- `callback` **[Function][1]** a method that takes (previousValue, currentSegment, currentIndex) | ||
- `initialValue` **any?** Value to use as the first argument to the first call of the callback. | ||
@@ -661,10 +661,10 @@ | ||
Type: [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) | ||
Type: [Function][1] | ||
**Parameters** | ||
- `currentLine` **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)<[LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4)>** The current LineString|LinearRing being processed | ||
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Feature being processed | ||
- `multiFeatureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Multi-Feature being processed | ||
- `geometryIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Geometry being processed | ||
- `currentLine` **[Feature][5]<[LineString][10]>** The current LineString|LinearRing being processed | ||
- `featureIndex` **[number][3]** The current index of the Feature being processed | ||
- `multiFeatureIndex` **[number][3]** The current index of the Multi-Feature being processed | ||
- `geometryIndex` **[number][3]** The current index of the Geometry being processed | ||
@@ -678,4 +678,4 @@ ## lineEach | ||
- `geojson` **([Geometry](https://tools.ietf.org/html/rfc7946#section-3.1) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2)<([LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4) \| [Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6) \| [MultiLineString](https://tools.ietf.org/html/rfc7946#section-3.1.5) \| [MultiPolygon](https://tools.ietf.org/html/rfc7946#section-3.1.7))>)** object | ||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (currentLine, featureIndex, multiFeatureIndex, geometryIndex) | ||
- `geojson` **([Geometry][6] \| [Feature][5]<([LineString][10] \| [Polygon][11] \| [MultiLineString][12] \| [MultiPolygon][13])>)** object | ||
- `callback` **[Function][1]** a method that takes (currentLine, featureIndex, multiFeatureIndex, geometryIndex) | ||
@@ -715,3 +715,3 @@ **Examples** | ||
Type: [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) | ||
Type: [Function][1] | ||
@@ -722,6 +722,6 @@ **Parameters** | ||
of the callback, or initialValue, if supplied. | ||
- `currentLine` **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)<[LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4)>** The current LineString|LinearRing being processed. | ||
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Feature being processed | ||
- `multiFeatureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Multi-Feature being processed | ||
- `geometryIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The current index of the Geometry being processed | ||
- `currentLine` **[Feature][5]<[LineString][10]>** The current LineString|LinearRing being processed. | ||
- `featureIndex` **[number][3]** The current index of the Feature being processed | ||
- `multiFeatureIndex` **[number][3]** The current index of the Multi-Feature being processed | ||
- `geometryIndex` **[number][3]** The current index of the Geometry being processed | ||
@@ -734,4 +734,4 @@ ## lineReduce | ||
- `geojson` **([Geometry](https://tools.ietf.org/html/rfc7946#section-3.1) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2)<([LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4) \| [Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6) \| [MultiLineString](https://tools.ietf.org/html/rfc7946#section-3.1.5) \| [MultiPolygon](https://tools.ietf.org/html/rfc7946#section-3.1.7))>)** object | ||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (previousValue, currentLine, featureIndex, multiFeatureIndex, geometryIndex) | ||
- `geojson` **([Geometry][6] \| [Feature][5]<([LineString][10] \| [Polygon][11] \| [MultiLineString][12] \| [MultiPolygon][13])>)** object | ||
- `callback` **[Function][1]** a method that takes (previousValue, currentLine, featureIndex, multiFeatureIndex, geometryIndex) | ||
- `initialValue` **any?** Value to use as the first argument to the first call of the callback. | ||
@@ -768,11 +768,11 @@ | ||
- `geojson` **([FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2) \| [Geometry](https://tools.ietf.org/html/rfc7946#section-3.1))** Any GeoJSON Feature or Geometry | ||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Optional parameters (optional, default `{}`) | ||
- `options.featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Feature Index (optional, default `0`) | ||
- `options.multiFeatureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Multi-Feature Index (optional, default `0`) | ||
- `options.geometryIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Geometry Index (optional, default `0`) | ||
- `options.segmentIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Segment Index (optional, default `0`) | ||
- `options.properties` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Translate Properties to output LineString (optional, default `{}`) | ||
- `options.bbox` **[BBox](https://tools.ietf.org/html/rfc7946#section-5)** Translate BBox to output LineString (optional, default `{}`) | ||
- `options.id` **([number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) \| [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** Translate Id to output LineString (optional, default `{}`) | ||
- `geojson` **([FeatureCollection][4] \| [Feature][5] \| [Geometry][6])** Any GeoJSON Feature or Geometry | ||
- `options` **[Object][8]** Optional parameters (optional, default `{}`) | ||
- `options.featureIndex` **[number][3]** Feature Index (optional, default `0`) | ||
- `options.multiFeatureIndex` **[number][3]** Multi-Feature Index (optional, default `0`) | ||
- `options.geometryIndex` **[number][3]** Geometry Index (optional, default `0`) | ||
- `options.segmentIndex` **[number][3]** Segment Index (optional, default `0`) | ||
- `options.properties` **[Object][8]** Translate Properties to output LineString (optional, default `{}`) | ||
- `options.bbox` **[BBox][14]** Translate BBox to output LineString (optional, default `{}`) | ||
- `options.id` **([number][3] \| [string][9])** Translate Id to output LineString (optional, default `{}`) | ||
@@ -800,3 +800,3 @@ **Examples** | ||
Returns **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)<[LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4)>** 2-vertex GeoJSON Feature LineString | ||
Returns **[Feature][5]<[LineString][10]>** 2-vertex GeoJSON Feature LineString | ||
@@ -811,11 +811,11 @@ ## findPoint | ||
- `geojson` **([FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2) \| [Geometry](https://tools.ietf.org/html/rfc7946#section-3.1))** Any GeoJSON Feature or Geometry | ||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Optional parameters (optional, default `{}`) | ||
- `options.featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Feature Index (optional, default `0`) | ||
- `options.multiFeatureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Multi-Feature Index (optional, default `0`) | ||
- `options.geometryIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Geometry Index (optional, default `0`) | ||
- `options.coordIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Coord Index (optional, default `0`) | ||
- `options.properties` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Translate Properties to output Point (optional, default `{}`) | ||
- `options.bbox` **[BBox](https://tools.ietf.org/html/rfc7946#section-5)** Translate BBox to output Point (optional, default `{}`) | ||
- `options.id` **([number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) \| [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** Translate Id to output Point (optional, default `{}`) | ||
- `geojson` **([FeatureCollection][4] \| [Feature][5] \| [Geometry][6])** Any GeoJSON Feature or Geometry | ||
- `options` **[Object][8]** Optional parameters (optional, default `{}`) | ||
- `options.featureIndex` **[number][3]** Feature Index (optional, default `0`) | ||
- `options.multiFeatureIndex` **[number][3]** Multi-Feature Index (optional, default `0`) | ||
- `options.geometryIndex` **[number][3]** Geometry Index (optional, default `0`) | ||
- `options.coordIndex` **[number][3]** Coord Index (optional, default `0`) | ||
- `options.properties` **[Object][8]** Translate Properties to output Point (optional, default `{}`) | ||
- `options.bbox` **[BBox][14]** Translate BBox to output Point (optional, default `{}`) | ||
- `options.id` **([number][3] \| [string][9])** Translate Id to output Point (optional, default `{}`) | ||
@@ -843,4 +843,34 @@ **Examples** | ||
Returns **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)<[Point](https://tools.ietf.org/html/rfc7946#section-3.1.2)>** 2-vertex GeoJSON Feature Point | ||
Returns **[Feature][5]<[Point][15]>** 2-vertex GeoJSON Feature Point | ||
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function | ||
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array | ||
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number | ||
[4]: https://tools.ietf.org/html/rfc7946#section-3.3 | ||
[5]: https://tools.ietf.org/html/rfc7946#section-3.2 | ||
[6]: https://tools.ietf.org/html/rfc7946#section-3.1 | ||
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean | ||
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object | ||
[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String | ||
[10]: https://tools.ietf.org/html/rfc7946#section-3.1.4 | ||
[11]: https://tools.ietf.org/html/rfc7946#section-3.1.6 | ||
[12]: https://tools.ietf.org/html/rfc7946#section-3.1.5 | ||
[13]: https://tools.ietf.org/html/rfc7946#section-3.1.7 | ||
[14]: https://tools.ietf.org/html/rfc7946#section-5 | ||
[15]: https://tools.ietf.org/html/rfc7946#section-3.1.2 | ||
<!-- This file is automatically generated. Please don't edit it directly: | ||
@@ -847,0 +877,0 @@ if you find an error, edit the source file (likely index.js), and re-run |
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
859
84239
5
1278