Socket
Socket
Sign inDemoInstall

turf-featurecollection

Package Overview
Dependencies
Maintainers
1
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 0.1.0 to 1.0.0

.travis.yml

4

index.js

@@ -5,5 +5,5 @@ module.exports = function(features){

"features": features
}
};
return fc
return fc;
}
{
"name": "turf-featurecollection",
"version": "0.1.0",
"version": "1.0.0",
"description": "turf featureCollection module",

@@ -25,6 +25,7 @@ "main": "index.js",

"homepage": "https://github.com/morganherlocker/turf-featureCollection",
"devDependencies": [
"tape",
"turf-point"
]
"devDependencies": {
"benchmark": "^1.0.0",
"tape": "^3.0.3",
"turf-point": "^1.2.0"
}
}
turf-featureCollection
======================
[![Build Status](https://travis-ci.org/Turfjs/turf-featureCollection.svg)](https://travis-ci.org/Turfjs/turf-featureCollection)
Creates a geojson FeatureCollection based on an array of features.
```js
var featurecollection = require('turf-featurecollection')
var point = require('turf-point')
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 = featurecollection([pt1, pt2, pt3])
console.log(fc)
```
var test = require('tape');
var featureCollection = require('./')
var point = require('turf-point')
var featureCollection = require('./');
var point = require('turf-point');
test('featureCollection', function(t){
t.plan(7)
t.plan(7);

@@ -11,12 +11,12 @@ var p1 = point(0,0, {name: 'first point'}),

p3 = point(10,10),
p4 = point(10,0)
var fc = featureCollection([p1,p2,p3,p4])
p4 = point(10,0);
var fc = featureCollection([p1,p2,p3,p4]);
t.ok(fc);
t.equal(fc.features.length, 4)
t.equal(fc.features[0].properties.name, 'first point')
t.equal(fc.type, 'FeatureCollection')
t.equal(fc.features[1].geometry.type, 'Point')
t.equal(fc.features[1].geometry.coordinates[0], 0)
t.equal(fc.features[1].geometry.coordinates[1], 10)
t.equal(fc.features.length, 4);
t.equal(fc.features[0].properties.name, 'first point');
t.equal(fc.type, 'FeatureCollection');
t.equal(fc.features[1].geometry.type, 'Point');
t.equal(fc.features[1].geometry.coordinates[0], 0);
t.equal(fc.features[1].geometry.coordinates[1], 10);
});

Sorry, the diff of this file is not supported yet

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