Skip to content

Commit

Permalink
Merge pull request #1302 from pelias/greenkeeper/geolib-3.0.0
Browse files Browse the repository at this point in the history
Update geolib to the latest version 🚀
  • Loading branch information
orangejulius authored May 24, 2019
2 parents ceaf1f0 + c7fafda commit 78f1e67
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions controller/placeholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ function getBoundaryRectangleFilter(clean, do_geometric_filters_apply) {
{ latitude: clean['boundary.rect.max_lat'], longitude: clean['boundary.rect.max_lon'] },
{ latitude: clean['boundary.rect.min_lat'], longitude: clean['boundary.rect.max_lon'] }
];
// isPointInside takes polygon last, so create a function that has it pre-populated
const isPointInsidePolygon = _.partialRight(geolib.isPointInside, polygon);
// isPointInPolygon takes polygon last, so create a function that has it pre-populated
const isPointInsidePolygon = _.partialRight(geolib.isPointInPolygon, polygon);

return _.partial(isInsideGeometry, isPointInsidePolygon);

Expand All @@ -158,8 +158,8 @@ function getBoundaryCircleFilter(clean, do_geometric_filters_apply) {
};
const radiusInMeters = clean['boundary.circle.radius'] * 1000;

// isPointInCircle takes circle/radius last, so create a function that has them pre-populated
const isPointInCircle = _.partialRight(geolib.isPointInCircle, center, radiusInMeters);
// isPointWithinRadius takes circle/radius last, so create a function that has them pre-populated
const isPointInCircle = _.partialRight(geolib.isPointWithinRadius, center, radiusInMeters);

return _.partial(isInsideGeometry, isPointInCircle);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"elasticsearch": "^15.0.0",
"express": "^4.8.8",
"geojson": "^0.5.0",
"geolib": "^2.0.18",
"geolib": "^3.0.0",
"iso-639-3": "^1.0.0",
"joi": "^14.0.0",
"locale": "^0.1.0",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/middleware/distance.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports.tests.computeDistance = function(test, common) {
]
};

var expected = 742.348;
var expected = 742.735;
distance(req, res, function () {
t.equal(res.data[0].distance, expected, 'correct distance computed');
t.end();
Expand Down

0 comments on commit 78f1e67

Please sign in to comment.