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.95 to 0.0.97

lib/convex.js

2

index.js
module.exports = {
merge: require('./lib/merge'),
convex: require('./lib/convex'),
donuts: require('./lib/donuts'),

@@ -3,0 +5,0 @@ within: require('./lib/within'),

12

lib/union.js

@@ -10,11 +10,15 @@ // look here for help http://svn.osgeo.org/grass/grass/branches/releasebranch_6_4/vector/v.overlay/main.c

module.exports = function(polys1, polys2, done){
module.exports = function(poly1, poly2, done){
var reader = new jsts.io.GeoJSONReader()
var a = reader.read(JSON.stringify(polys1.features[0].geometry))
var b = reader.read(JSON.stringify(polys2.features[0].geometry))
var a = reader.read(JSON.stringify(poly1.geometry))
var b = reader.read(JSON.stringify(poly2.geometry))
var union = a.union(b);
var parser = new jsts.io.GeoJSONParser()
union = parser.write(union)
union = t.featurecollection([union])
union = {
type: 'Feature',
geometry: union,
properties: poly1.properties
}
done(null, union)
}
{
"name": "turf",
"version": "0.0.95",
"version": "0.0.97",
"description": "a node.js library for performing geospatial operations with geojson",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -90,2 +90,3 @@ turf

- [union](#union)
- [merge](#merge)
- [intersect](#intersect)

@@ -1020,2 +1021,18 @@ - [erase](#erase)

###merge
Takes a feature collection of polygons and outputs a single merged polygon feature.
```javascript
var t = require('turf')
t.load(__dirname + '/testIn/mergeIn.geojson', function(err, polys){
t.merge(polys, function(err, merged){
if(err) throw err
console.log(unioned)
})
})
```
###intersect

@@ -1022,0 +1039,0 @@

@@ -9,5 +9,5 @@ var t = require('../index'),

t.load(__dirname + '/testIn/Intersect2.geojson', function(err, polys2){
t.union(polys1, polys2, function(err, unioned){
t.union(polys1.features[0], polys2.features[0], function(err, unioned){
if(err) throw err
unioned.features[0].should.be.ok
unioned.should.be.ok
fs.writeFileSync(__dirname + '/testOut/unioned.geojson', JSON.stringify(unioned))

@@ -14,0 +14,0 @@ done()

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc