Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

turf-intersect

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-intersect - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

test/fixtures/no-overlap.geojson

11

index.js

@@ -30,4 +30,13 @@ // depend on jsts for now https://github.com/bjornharrtell/jsts/blob/master/examples/overlay.html

intersection = parser.write(intersection);
intersection = featurecollection([intersection]);
if(intersection.type === 'GeometryCollection' && intersection.geometries.length === 0) {
intersection = [];
} else {
intersection = {
type: "Feature",
geometry: intersection,
properties: {}
};
}
return intersection;
}

2

package.json
{
"name": "turf-intersect",
"version": "1.0.2",
"version": "1.1.0",
"description": "find the intersection of spatial features",

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

@@ -1,1 +0,1 @@

{"type":"FeatureCollection","features":[{"type":"Polygon","coordinates":[[[43.582746,41.092143],[44.97248,41.248129],[45.179496,40.985354],[45.560351,40.81229],[45.359175,40.561504],[45.891907,40.218476],[45.610012,39.899994],[46.034534,39.628021],[46.483499,39.464155],[46.50572,38.770605],[46.143623,38.741201],[45.735379,39.319719],[45.739978,39.473999],[45.298145,39.471751],[45.001987,39.740004],[44.79399,39.713003],[44.400009,40.005],[43.656436,40.253564],[43.752658,40.740201],[43.582746,41.092143]]]}]}
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[43.582746,41.092143],[44.97248,41.248129],[45.179496,40.985354],[45.560351,40.81229],[45.359175,40.561504],[45.891907,40.218476],[45.610012,39.899994],[46.034534,39.628021],[46.483499,39.464155],[46.50572,38.770605],[46.143623,38.741201],[45.735379,39.319719],[45.739978,39.473999],[45.298145,39.471751],[45.001987,39.740004],[44.79399,39.713003],[44.400009,40.005],[43.656436,40.253564],[43.752658,40.740201],[43.582746,41.092143]]]},"properties":{}}

@@ -1,1 +0,1 @@

{"type":"FeatureCollection","features":[{"type":"Polygon","coordinates":[[[-79.94623496447946,32.89900638172028],[-79.88571166992188,32.887659962078956],[-79.89395141601562,32.75551989829049],[-79.92322780260464,32.73910022106017],[-79.93789672851562,32.74108223150125],[-79.93034362792969,32.76475877693074],[-79.97360229492188,32.76071688548088],[-79.97428894042969,32.83690450361482],[-79.94623496447946,32.89900638172028]]]}]}
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-79.94623496447946,32.89900638172028],[-79.88571166992188,32.887659962078956],[-79.89395141601562,32.75551989829049],[-79.92322780260464,32.73910022106017],[-79.93789672851562,32.74108223150125],[-79.93034362792969,32.76475877693074],[-79.97360229492188,32.76071688548088],[-79.97428894042969,32.83690450361482],[-79.94623496447946,32.89900638172028]]]},"properties":{}}

@@ -1,1 +0,1 @@

{"type":"FeatureCollection","features":[{"type":"GeometryCollection","geometries":[]}]}
[]

@@ -6,3 +6,3 @@ var intersect = require('../'),

var REGEN = false;
var REGEN = true;

@@ -37,2 +37,9 @@ test('intersect -- featurecollection', function(t){

t.end();
});
test('intersect -- no overlap', function(t){
var noOverlap = JSON.parse(fs.readFileSync(__dirname+'/fixtures/no-overlap.geojson'));
var output = intersect(noOverlap.features[0].geometry, noOverlap.features[1].geometry);
t.deepEqual(output, []);
t.end();
});
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