geojson-random
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -0,1 +1,6 @@ | ||
# 1.0.1 | ||
* Fix `coordInBBBOX` function to fix the output of points within small bounding | ||
boxes. | ||
# 1.0.0 | ||
@@ -2,0 +7,0 @@ |
@@ -71,8 +71,5 @@ module.exports = function() { | ||
function coordInBBBOX(bbox) { | ||
var lonSpan = bbox[2] - bbox[0], | ||
latSpan = bbox[3] - bbox[1], | ||
randInSpan = Math.random() * (lonSpan * latSpan); | ||
return [ | ||
(bbox[2] === bbox[0]) ? bbox[2] : randInSpan % (lonSpan) + bbox[0], | ||
(bbox[3] === bbox[1]) ? bbox[1] : randInSpan / (latSpan) + bbox[1]]; | ||
(Math.random() * (bbox[2] - bbox[0])) + bbox[0], | ||
(Math.random() * (bbox[3] - bbox[1])) + bbox[1]]; | ||
} | ||
@@ -79,0 +76,0 @@ |
{ | ||
"name": "geojson-random", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "generate random geojson features", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
7754
139