Socket
Socket
Sign inDemoInstall

geojson-random

Package Overview
Dependencies
13
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.2 to 0.3.0

.tern-port

6

CHANGELOG.md

@@ -1,3 +0,7 @@

# 1.0.1
# 0.3.0
* Add pointStream method
# 0.2.2
* Fix `coordInBBBOX` function to fix the output of points within small bounding

@@ -4,0 +8,0 @@ boxes.

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

var from = require('from2');
module.exports = function() {

@@ -14,3 +16,3 @@ throw new Error('call .point() or .polygon() instead');

var features = [];
for (i = 0; i < count; i++) {
for (var i = 0; i < count; i++) {
features.push(feature(bbox ? point(position(bbox)) : point()));

@@ -21,2 +23,12 @@ }

module.exports.pointStream = function(count, bbox) {
return from.obj(function(size, next) {
if (--count) {
next(null, feature(bbox ? point(position(bbox)) : point()));
} else {
next(null, null);
}
});
};
module.exports.polygon = function(count, num_vertices, max_radial_length, bbox) {

@@ -23,0 +35,0 @@ if (typeof num_vertices !== 'number') num_vertices = 10;

{
"name": "geojson-random",
"version": "0.2.2",
"version": "0.3.0",
"description": "generate random geojson features",

@@ -28,3 +28,7 @@ "main": "index.js",

"tape": "~2.13.4"
},
"dependencies": {
"from2": "^2.1.0",
"geojson-stream": "0.0.0"
}
}

@@ -12,2 +12,5 @@ # geojson-random

# special fast-mode for points
geojson-random 10000 point-stream
## api

@@ -36,3 +39,3 @@

### `random.polygon(count, num_vertices, max_radial_length)`
### `random.polygon(count, num_vertices, max_radial_length, bbox)`

@@ -46,1 +49,2 @@ Return `count` polygons wrapped in a FeatureCollection.

Default is `10`.
* `bbox` (Optional) Bounding box in [minX, minY, maxX, maxY] order.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc