Socket
Socket
Sign inDemoInstall

turf-featurecollection

Package Overview
Dependencies
Maintainers
8
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-featurecollection - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

1

bench.js

@@ -11,3 +11,2 @@ var featurecollection = require('./');

var suite = new Benchmark.Suite('turf-featurecollection');

@@ -14,0 +13,0 @@ suite

28

index.js

@@ -0,8 +1,24 @@

/**
* Takes one or more {@link Feature|Features} and creates a {@link FeatureCollection}
*
* @module turf/featurecollection
* @category helper
* @param {Feature} features input Features
* @returns {FeatureCollection} a FeatureCollection of input features
* @example
* var features = [
* turf.point([-75.343, 39.984], {name: 'Location A'}),
* turf.point([-75.833, 39.284], {name: 'Location B'}),
* turf.point([-75.534, 39.123], {name: 'Location C'})
* ];
*
* var fc = turf.featurecollection(features);
*
* //=fc
*/
module.exports = function(features){
var fc = {
"type": "FeatureCollection",
"features": features
return {
type: "FeatureCollection",
features: features
};
return fc;
}
};
{
"name": "turf-featurecollection",
"version": "1.0.0",
"version": "1.0.1",
"description": "turf featureCollection module",
"main": "index.js",
"scripts": {
"test": "tape test.js"
"test": "tape test.js",
"doc": "dox -r < index.js | doxme --readme > README.md"
},
"repository": {
"type": "git",
"url": "https://github.com/morganherlocker/turf-featureCollection.git"
"url": "https://github.com/Turfjs/turf-featureCollection.git"
},

@@ -22,10 +23,12 @@ "keywords": [

"bugs": {
"url": "https://github.com/morganherlocker/turf-featureCollection/issues"
"url": "https://github.com/Turfjs/turf-featureCollection/issues"
},
"homepage": "https://github.com/morganherlocker/turf-featureCollection",
"homepage": "https://github.com/Turfjs/turf-featureCollection",
"devDependencies": {
"benchmark": "^1.0.0",
"tape": "^3.0.3",
"turf-point": "^1.2.0"
"tape": "^3.5.0",
"turf-point": "^2.0.0",
"dox": "^0.6.1",
"doxme": "^1.4.3"
}
}

@@ -1,17 +0,50 @@

turf-featureCollection
======================
[![Build Status](https://travis-ci.org/Turfjs/turf-featureCollection.svg)](https://travis-ci.org/Turfjs/turf-featureCollection)
# turf-featurecollection
Creates a geojson FeatureCollection based on an array of features.
[![build status](https://secure.travis-ci.org/Turfjs/turf-featureCollection.png)](http://travis-ci.org/Turfjs/turf-featureCollection)
turf featureCollection module
### `turf.featurecollection(features)`
Takes one or more Feature|Features and creates a FeatureCollection
### Parameters
| parameter | type | description |
| ---------- | ------- | -------------- |
| `features` | Feature | input Features |
### Example
```js
var featurecollection = require('turf-featurecollection')
var point = require('turf-point')
var features = [
turf.point([-75.343, 39.984], {name: 'Location A'}),
turf.point([-75.833, 39.284], {name: 'Location B'}),
turf.point([-75.534, 39.123], {name: 'Location C'})
];
var pt1 = point(-75.343, 39.984, {name: 'Location A'})
var pt2 = point(-75.833, 39.284, {name: 'Location B'})
var pt3 = point(-75.534, 39.123, {name: 'Location C'})
var fc = turf.featurecollection(features);
var fc = featurecollection([pt1, pt2, pt3])
console.log(fc)
```
//=fc
```
**Returns** `FeatureCollection`, a FeatureCollection of input features
## Installation
Requires [nodejs](http://nodejs.org/).
```sh
$ npm install turf-featurecollection
```
## Tests
```sh
$ npm test
```

@@ -8,6 +8,6 @@ var test = require('tape');

var p1 = point(0,0, {name: 'first point'}),
p2 = point(0,10),
p3 = point(10,10),
p4 = point(10,0);
var p1 = point([0,0], {name: 'first point'}),
p2 = point([0,10]),
p3 = point([10,10]),
p4 = point([10,0]);
var fc = featureCollection([p1,p2,p3,p4]);

@@ -22,2 +22,2 @@

t.equal(fc.features[1].geometry.coordinates[1], 10);
});
});
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