Socket
Socket
Sign inDemoInstall

turf

Package Overview
Dependencies
Maintainers
1
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf - npm Package Compare versions

Comparing version 0.0.56 to 0.0.57

test/testOut/sample.geojson

1

index.js
module.exports = {
sample: require('./lib/sample'),
jenks: require('./lib/jenks'),

@@ -3,0 +4,0 @@ quantile: require('./lib/quantile'),

7

package.json
{
"name": "turf",
"version": "0.0.56",
"version": "0.0.57",
"description": "a node.js library for performing geospatial operations with geojson",

@@ -32,3 +32,6 @@ "main": "index.js",

"midpoint",
"plane"
"plane",
"quantile",
"jenks",
"sample"
],

@@ -35,0 +38,0 @@ "author": "",

@@ -53,2 +53,3 @@ turf

- contour
- sample

@@ -59,2 +60,5 @@ **Planned Features**

- interval
- cluster
- size
- bezier

@@ -66,3 +70,2 @@ - interpolate

- intersect
- reclass
- remove

@@ -72,2 +75,3 @@ - union

- smooth
- simplify

@@ -494,2 +498,20 @@ - - -

**sample**
Takes a feature collection and returns N random features as a feature collection.
```javascript
var t = require('turf')
var num = 10
t.load('./testIn/Points3.geojson', function(err, pts){
if(err) throw err
t.sample(pts, num, function(err, outPts){
if(err) throw err
console.log(outPts)
})
})
```
- - -

@@ -496,0 +518,0 @@

@@ -17,3 +17,3 @@ var t = require('../index'),

outPts.features[0].geometry.type.should.equal('Point')
t.save('./testOut/reclassed.geojson', outPts, 'geojson')
t.save('./testOut/reclassed.geojson', outPts, 'geojson', function(){})
done()

@@ -20,0 +20,0 @@ })

var t = require('../index'),
should = require('should')
should = require('should')
describe('sample', function(){
xit('should output a random sample of points from a feature collection', function(done){
xit('should take a feature collection and a number and return a random sample of n length', function(done){
var num = 10
done()
t.load('./testIn/Points3.geojson', function(err, pts){
if(err) throw err
pts.should.be.ok
t.sample(pts, num, function(err, outPts){
if(err) throw err
outPts.should.be.ok
outPts.features.length.should.equal(10)
t.save('./testOut/sample.geojson', outPts, 'geojson', function(){})
done()
})
})
})
})

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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