Comparing version 1.3.1 to 1.4.0
@@ -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")) { |
{ | ||
"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": { |
16
test.js
@@ -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 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
18005
482
7
1