nycplanning / labs-geojson2mvt Goto Github PK
View Code? Open in Web Editor NEWCuts a file pyramid of static vector tiles from a geojson file.
License: MIT License
Cuts a file pyramid of static vector tiles from a geojson file.
License: MIT License
Running geojson2mvt on a large region tends to crash with the javascript heap size limit being reached. I think something is leaking memory in there. Plot shows heapsize vs tile number. You can see the Garbage collection working but its not grabbing everything.
Not sure if this is an issue in geojson2mvt or one of the required libraries but investigating.
A bit revision will benefit users of older Node.js versions.
Would be great to have available as a shell command, for global install and quick usage from the command line.
See: https://developer.atlassian.com/blog/2015/11/scripting-with-node/#packaging-shell-commands
Maybe an issue with default setting of geojson-vt. Used your example but end up with all mvt's having file size 0 from z=15 and up.
I would like to generate mvt pyramids with your package for really big geojson file(2GB). It is not possible with fs.readFileSync
, because of file size. How can I deal with this problem?
Is it possible to generate piramides for many geojson files? Or maybe I should use streams?
Is it use case for multiple layers? Should I cut geojson on many smaller?
Would you be open to accepting a pull request that changes the API slightly to support multiple layers? Something like
var fs = require('fs');
var geojson2mvt = require('geojson2mvt');
const busRoutes = './bus_routes.geojson';
const busStops = './bus_stops.geojson';
var options = {
rootDir: 'tiles',
bbox : [40.426042,-74.599228,40.884448,-73.409958], //[south,west,north,east]
zoom : {
min : 8,
max : 18,
},
layers: {
'layer0': JSON.parse(fs.readFileSync(busRoutes, "utf8")),
'layer1': JSON.parse(fs.readFileSync(busStops, "utf8"))
},
};
// build the static tile pyramid
geojson2mvt(options);
I could also make this in a backwards compatible way, if desired.
We should have the first argument be a geojson object, not a path to a geojson file. This will allow people to manipulate their data in javascript before passing it into geojson2mvt()
The npm package and this repo do not match
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.