
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@hotosm/geojson2vt
Advanced tools
Generates Mapbox Vector Tiles from geojson files. It will output a directory containing the vector tiles in the pbf format with gzip compression.
npm install @hotosm/geojson2vt
geojson2vt
takes a config object with the GeoJSONs to encode and other options, and builds the vector tiles pyramid in the specified output directory.
var fs = require('fs');
var geojson2vt = require('geojson2vt');
var options = {
layers: {
layer0: JSON.parse(fs.readFileSync('bus_routes.geojson', "utf8")),
layer1: JSON.parse(fs.readFileSync('stops.geojson', "utf8"))
},
rootDir: 'tiles',
bbox : [40.426042,-74.599228,40.884448,-73.409958], //[south,west,north,east]
zoom : {
min : 8,
max : 18,
}
};
// build the static tile pyramid
geojson2vt(options);
layers
- Object<string,Object> (required) - GeoJSONs to create a vector tileset from. Keys are the layer names that will be used to access data from the respective GeoJSON when displaying data from the MVT.
rootDir
- string (required) - the filepath of the directory that will be the root of the file pyramid. It will be created if it doesn't exist.
bbox
- array (required) - array of lat/lon bounds like [s,w,n,e]
zoom
- object (required) - object with min
and max
properties for the desired zoom levels in the tile pyramid
Instead of providing a single config object, you can provide two arguments: a geoJson and config object without a layers
property, but instead with a layerName
property for the name for the imported geoJson in the MVT.
FAQs
Generates Mapbox Vector Tiles from geojson files.
The npm package @hotosm/geojson2vt receives a total of 0 weekly downloads. As such, @hotosm/geojson2vt popularity was classified as not popular.
We found that @hotosm/geojson2vt demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.