
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
vector-tile
Advanced tools
This library reads Mapbox Vector Tiles and allows access to the layers and features.
var VectorTile = require('vector-tile').VectorTile;
var Protobuf = require('pbf');
var tile = new VectorTile(new Protobuf(data));
// Contains a map of all layers
tile.layers;
var landuse = tile.layers.landuse;
// Amount of features in this layer
landuse.length;
// Returns the first feature
landuse.feature(0);
Vector tiles contained in serialtiles-spec are gzip-encoded, so a complete example of parsing them with the native zlib module would be:
var VectorTile = require('vector-tile').VectorTile;
var Protobuf = require('pbf');
var zlib = require('zlib');
zlib.gunzip(data, function(err, buffer) {
var tile = new VectorTile(new Protobuf(buffer));
});
To install:
npm install vector-tile
An object that parses vector tile data and makes it readable.
layers
property. Optionally accepts end index.{<name>: <layer>, ...}
,
where each layer is a VectorTileLayer
object.An object that contains the data for a single vector tile layer.
Number
, default: 1
)String)
— layer nameNumber
, default: 4096
) — tile extent sizeNumber
) — number of features in the layerVectorTileFeature
) by the given index from the layer.An object that contains the data for a single feature.
Number
) — type of the feature (also see VectorTileFeature.types
)Number
) — feature extent sizeNumber
) — feature identifier, if presentObject
) — object literal with feature propertiesx
and y
properties)[x1, y1, x2, y2]
x
, y
, and z
refer to the containing tile's index.)FAQs
Parses vector tiles
The npm package vector-tile receives a total of 0 weekly downloads. As such, vector-tile popularity was classified as not popular.
We found that vector-tile demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 29 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.