Comparing version 0.0.121 to 0.0.122
@@ -9,3 +9,4 @@ /* | ||
var _ = require('lodash') | ||
var _ = require('lodash'), | ||
extractor = require('poly-extractor') | ||
var t = {} | ||
@@ -19,2 +20,3 @@ t.featurecollection = require('./featurecollection') | ||
module.exports = function(polyFC, done){ | ||
polyFC | ||
donuts = t.featurecollection([]) | ||
@@ -27,2 +29,3 @@ _.each(polyFC.features, function(poly1){ | ||
t.erase(poly1, poly2, function(err, erased){ | ||
//console.log(erased.geometry.type) | ||
var duplicate = _.some(donuts.features, erased) | ||
@@ -32,2 +35,5 @@ if(!duplicate && erased.geometry.type != 'GeometryCollection'){ | ||
} | ||
else if (erased.geometry.type == 'GeometryCollection'){ | ||
//console.log('GCOLLECTION') | ||
} | ||
}) | ||
@@ -42,2 +48,5 @@ } | ||
else{ | ||
//console.log('==============================\n\n') | ||
//console.log(poly1) | ||
//console.log(poly2) | ||
//t.union(poly1, poly2, function(err, unioned){ | ||
@@ -44,0 +53,0 @@ // donuts.features.push(unioned) |
{ | ||
"name": "turf", | ||
"version": "0.0.121", | ||
"version": "0.0.122", | ||
"description": "a node.js library for performing geospatial operations with geojson", | ||
@@ -50,3 +50,3 @@ "main": "index.js", | ||
"async": "~0.2.10", | ||
"jsts": "~0.13.2" | ||
"jsts": "~0.13.4" | ||
}, | ||
@@ -53,0 +53,0 @@ "devDependencies": { |
turf | ||
====== | ||
[![Build Status](https://travis-ci.org/morganherlocker/turf.png)](https://travis-ci.org/morganherlocker/turf) | ||
![turf](https://raw.github.com/morganherlocker/turf/master/img/turf.png) | ||
@@ -20,3 +23,3 @@ | ||
```html | ||
<script src="turf.min.js"></script> | ||
<script src="turf.min.js"></script> | ||
``` | ||
@@ -175,3 +178,3 @@ | ||
var linestring1 = t.linestring([[102.0, -10.0], [103.0, 1.0], [104.0, 0.0], [130.0, 4.0]]) | ||
var linestring2 = t.linestring([[102.0, -10.0], [103.0, 1.0], [104.0, 0.0], [130.0, 4.0]], | ||
var linestring2 = t.linestring([[102.0, -10.0], [103.0, 1.0], [104.0, 0.0], [130.0, 4.0]], | ||
{name: 'line 1', distance: 145}) | ||
@@ -191,3 +194,3 @@ console.log(linestring1) | ||
var polygon1 = t.point([[[20.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]]) | ||
var polygon2 = t.point([[[20.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]], | ||
var polygon2 = t.point([[[20.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]], | ||
{name: 'line 1', distance: 145}) | ||
@@ -356,3 +359,3 @@ console.log(polygon1) | ||
Combines feature collection of point, linestring, or polygon features into multipoint, multilinestring, or multipolygon features. | ||
```javascript | ||
@@ -374,3 +377,3 @@ var t = require('turf') | ||
Takes a ring and return true or false whether or not the ring is clockwise or counter-clockwise. | ||
```javascript | ||
@@ -395,4 +398,4 @@ var t = require('turf') | ||
var t = require('turf') | ||
var trees = t.featurecollection([t.point(1,2, {species: 'oak'}), | ||
t.point(2,1, {species: 'dogwood'}), | ||
var trees = t.featurecollection([t.point(1,2, {species: 'oak'}), | ||
t.point(2,1, {species: 'dogwood'}), | ||
t.point(3,1, {species: 'maple'})]) | ||
@@ -415,6 +418,6 @@ | ||
t.point(1,2, {species: 'oak'}), | ||
t.point(2,1, {species: 'birch'}), | ||
t.point(2,1, {species: 'birch'}), | ||
t.point(3,1, {species: 'oak'}), | ||
t.point(2,2, {species: 'redwood'}), | ||
t.point(2,3, {species: 'maple'}), | ||
t.point(2,2, {species: 'redwood'}), | ||
t.point(2,3, {species: 'maple'}), | ||
t.point(4,2, {species: 'oak'}) | ||
@@ -506,3 +509,3 @@ ]) | ||
```javascript | ||
var t = require('turf') | ||
var t = require('turf') | ||
var inPoint = t.point(-75.4, 39.4, {name: 'Location A'}) | ||
@@ -563,3 +566,3 @@ | ||
var triangle = t.polygon( | ||
[[[-75.1221,39.57],[-75.58,39.18],[-75.97,39.86]]], | ||
[[[-75.1221,39.57],[-75.58,39.18],[-75.97,39.86]]], | ||
{"a": 11, "b": 122, "c": 44} | ||
@@ -566,0 +569,0 @@ ) |
@@ -6,4 +6,16 @@ var t = require('../index'), | ||
describe('donuts', function(){ | ||
it('should take a set of polygons and return a set of donuts', function(done){ | ||
t.load(__dirname+'/testIn/donutBadRing.geojson', function(err, donutsIn){ | ||
if(err) throw err | ||
t.donuts(donutsIn, function(err, donuts){ | ||
if(err) throw err | ||
fs.writeFileSync(__dirname+'/testOut/donutsBadRing.geojson', JSON.stringify(donuts)) | ||
donuts.should.be.ok | ||
donuts.features.should.be.ok | ||
donuts.features[0].should.be.ok | ||
done() | ||
}) | ||
}) | ||
}) | ||
it('should take a set of polygons and return a set of donuts', function(done){ | ||
t.load(__dirname+'/testIn/donutsIn.geojson', function(err, donutsIn){ | ||
@@ -10,0 +22,0 @@ if(err) throw err |
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 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
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
AI-detected potential security risk
Supply chain riskAI has determined that this package may contain potential security issues or vulnerabilities.
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
4403327
246
1189
25063
3
Updatedjsts@~0.13.4