New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@hotosm/geojson2vt

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hotosm/geojson2vt - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

5

package.json
{
"name": "@hotosm/geojson2vt",
"version": "0.1.1",
"version": "0.1.2",
"description": "Generates Mapbox Vector Tiles from geojson files.",

@@ -23,4 +23,5 @@ "keywords": [

"geojson-vt": "^3.2.1",
"vt-pbf": "^3.1.1"
"vt-pbf": "^3.1.1",
"node-gzip": "^1.1.2"
}
}

2

README.md

@@ -25,3 +25,3 @@ # geojson2vt

rootDir: 'tiles',
bbox : [40.426042,-74.599228,40.884448,-73.409958], //[south,west,north,east]
bbox: [40.426042,-74.599228,40.884448,-73.409958], // [south,west,north,east]
zoom : {

@@ -28,0 +28,0 @@ min : 8,

var fs = require('fs');
var vtpbf = require('vt-pbf');
var geojsonvt = require('geojson-vt');
var zlib = require('zlib');
const { gzip } = require('node-gzip');

@@ -19,4 +19,3 @@ var helpers = require('./helpers.js');

var i = 0,
ii = layerNames.length;
var i = 0, ii = layerNames.length;
var tileIndex = new Array(ii);

@@ -45,2 +44,3 @@ for (; i < ii; ++i) {

//create z directory in the root directory
console.log(`Processing zoom ${z}`);
var zPath = `${options.rootDir}/${z.toString()}/`;

@@ -52,6 +52,4 @@ try {

}
// get the x and y bounds for the current zoom level
var tileBounds = helpers.getTileBounds(options.bbox, z);
console.log(tileBounds)
tileBounds = helpers.getTileBounds(options.bbox, z);

@@ -64,3 +62,3 @@ // x loop

try {
fs.mkdirSync(xPath, 0777)
fs.mkdirSync(xPath, 0777);
} catch (err) {

@@ -70,6 +68,4 @@ if (err.code !== 'EEXIST') callback(err);

// y loop
for (var y = tileBounds.yMin; y <= tileBounds.yMax; y++) {
console.log(`Getting tile ${z} ${x} ${y} `);
var mvt = getTile(z, x, y, tileIndex, layerNames);

@@ -90,9 +86,5 @@

function writePbf(data, xPath, y) {
zlib.gzip(
data,
(err, buffer) => {
fs.writeFileSync(`${xPath}/${y}.pbf`, buffer);
}
gzip(data).then(
buffer => fs.writeFileSync(`${xPath}/${y}.pbf`, buffer)
);
}

@@ -99,0 +91,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