Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vt-pbf

Package Overview
Dependencies
Maintainers
36
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vt-pbf

Serialize mapbox vector tiles to binary protobufs in javascript.

  • 3.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
997K
decreased by-11.33%
Maintainers
36
Weekly downloads
 
Created

What is vt-pbf?

The vt-pbf npm package is used for encoding vector tiles into Protocol Buffers (PBF) format. This is particularly useful in the context of geographic information systems (GIS) and mapping applications, where vector tiles are used to efficiently transmit map data.

What are vt-pbf's main functionalities?

Encoding GeoJSON to PBF

This feature allows you to encode a GeoJSON object into a PBF format. The code sample demonstrates how to convert a simple GeoJSON object into a PBF buffer.

const vtPbf = require('vt-pbf');
const geojson = { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "prop0": "value0" } } ] };
const pbf = vtPbf.fromGeojsonVt({ 'layerName': geojson });
console.log(pbf);

Encoding multiple layers

This feature allows you to encode multiple GeoJSON layers into a single PBF. The code sample demonstrates how to convert two GeoJSON objects into a PBF buffer with multiple layers.

const vtPbf = require('vt-pbf');
const geojson1 = { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "prop0": "value0" } } ] };
const geojson2 = { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "LineString", "coordinates": [ [102.0, 0.0], [103.0, 1.0] ] }, "properties": { "prop1": "value1" } } ] };
const pbf = vtPbf.fromGeojsonVt({ 'layer1': geojson1, 'layer2': geojson2 });
console.log(pbf);

Other packages similar to vt-pbf

FAQs

Package last updated on 07 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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