turf-featurecollection
Advanced tools
Comparing version 0.1.0 to 1.0.0
@@ -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) | ||
``` |
22
test.js
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
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4234
8
41
0
17
3
1