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

sphere-knn

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sphere-knn - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

7

lib/spherekd.js

@@ -33,2 +33,9 @@ "use strict";

else if(object.hasOwnProperty("geometry") &&
object.geometry.hasOwnProperty("type") &&
object.geometry.type === "Point") {
lat = object.geometry.coordinates[1];
lon = object.geometry.coordinates[0];
}
else {

@@ -35,0 +42,0 @@ if(object.hasOwnProperty("lat")) {

4

package.json
{
"name": "sphere-knn",
"version": "1.3.1",
"version": "1.4.0",
"description": "search for k nearest neighbors on a sphere",

@@ -14,3 +14,3 @@ "engines": {

"name": "The Dark Sky Company",
"email": "devsupport@darkskyapp.com"
"email": "developer@darksky.net"
},

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

@@ -243,2 +243,18 @@ var assert = require("chai").assert,

})
it("should allow building from geojson features", function() {
var features = cities.map(function(c) {
return {
'type': 'Feature',
'properties': {'name': c.name},
'geometry': {'type': 'Point', 'coordinates': [c.lon, c.lat]},
}
});
var tree = spherekd.build(features)
assert.deepEqual(
spherekd.lookup(39.95, -75.17, tree, 4).map(function(c) { return c.properties.name }),
['New York', 'Troy', 'Boston', 'Miami']
)
})
})

@@ -245,0 +261,0 @@

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