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.113 to 0.0.116

test/testIn/donutHoles.geojson

2

lib/buffer.js

@@ -7,3 +7,3 @@ //http://stackoverflow.com/questions/839899/how-do-i-calculate-a-point-on-a-circles-circumference

var _ = require('lodash'),
jsts = require('jsts'),
jsts = require('jsts')
var t = {}

@@ -10,0 +10,0 @@ t.featurecollection = require('./featurecollection')

//https://github.com/jasondavies/conrec.js
//http://stackoverflow.com/questions/263305/drawing-a-topographical-map
var _ = require('lodash')
var _ = require('lodash'),
async = require('async')
var t = {}

@@ -14,2 +15,3 @@ t.tin = require('./tin')

t.donuts = require('./donuts')
t.merge = require('./merge')

@@ -78,5 +80,24 @@ module.exports = function(points, z, resolution, breaks, donuts, done){

// perform donuts function before returning if donuts option is true
// perform donuts function and dissolves rings before returning if donuts option is true
if(donuts){
t.donuts(fc, function(err, donutPolys){
var zGroups = []
_.each(donutPolys.features, function(ring){
var found = false
_.each(zGroups, function(group){
if(group.z === ring.properties[z]){
found = true
group.rings.push(ring)
}
})
if(!found){
zGroups.push({z: ring.properties[z], rings: [ring]})
}
})
donutPolys.features = []
_.each(zGroups, function(group){
t.merge(t.featurecollection(group.rings), function(err, multiRing){
donutPolys.features.push(multiRing)
})
})
done(null, donutPolys)

@@ -83,0 +104,0 @@ })

@@ -15,2 +15,3 @@ /*

t.inside = require('./inside')
t.union = require('./union')

@@ -37,2 +38,7 @@ module.exports = function(polyFC, done){

}
else{
//t.union(poly1, poly2, function(err, unioned){
// donuts.features.push(unioned)
//})
}
}

@@ -39,0 +45,0 @@ })

{
"name": "turf",
"version": "0.0.113",
"version": "0.0.116",
"description": "a node.js library for performing geospatial operations with geojson",
"main": "index.js",
"scripts": {
"test": "mocha ./test/*"
"test": "mocha ./test/"
},

@@ -9,0 +9,0 @@ "repository": {

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

})
xit('should take a set of points lopsided edges and output a set of contour polygons', function(done){
it('should take a set of points lopsided edges and output a set of contour polygons', function(done){
t.load(__dirname+'/testIn/openContourPoints.geojson', function(err, points){

@@ -67,5 +67,5 @@ t.contour(points, 'elevation', 15, [5, 15, 40, 80, 90, 110], false, function(err, contours){

t.load(__dirname+'/testIn/holeContourPoints.geojson', function(err, points){
t.contour(points, 'elevation', 15, [5, 15, 40, 80, 90, 110], false, function(err, contours){
t.contour(points, 'elevation', 15, [5, 15, 40, 80, 90, 110], true, function(err, contours){
if(err) throw err
//fs.writeFileSync('./testOut/contoursHoles.geojson', JSON.stringify(contours))
fs.writeFileSync(__dirname+'/testOut/contoursHoles.geojson', JSON.stringify(contours))
contours.should.be.ok

@@ -72,0 +72,0 @@ contours.features.should.be.ok

@@ -34,7 +34,7 @@ var t = require('../index'),

it('should take a set of polygons and return a set of donuts with a shared edge', function(done){
t.load(__dirname+'/testIn/donutsIn3.geojson', function(err, donutsIn){
t.load(__dirname+'/testIn/donutHoles.geojson', function(err, donutsIn){
if(err) throw err
t.donuts(donutsIn, function(err, donuts){
if(err) throw err
//fs.writeFileSync('./testOut/donuts3.geojson', JSON.stringify(donuts))
fs.writeFileSync(__dirname+'/testOut/donuts3.geojson', JSON.stringify(donuts))
donuts.should.be.ok

@@ -41,0 +41,0 @@ donuts.features.should.be.ok

var t = require('../index'),
should = require('should'),
fs = require('fs')
should = require('should'),
fs = require('fs')

@@ -5,0 +5,0 @@ describe('merge', function(){

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc