node-mapnik
node-mapnik copied to clipboard
VectorTile decoding thresholds
Mapnik supports row_limit for traditional datasources and the VectorTile API should also support an option to limit the total # of decoded objects in cases where decoding everything would have memory implications.
This could either happen at vt.setData or vt.render. Because we lean on the libprotobuf ParseFromArray the former is not possible currently, so the latter makes the most sense for a first implementation.
var opts = { max_geometries:10000 };
vt.render(map,im,opts, callback);
Possible thresholds to support:
-
of layers
-
of features per layer
-
of geometries per feature
-
of attributes per feature
By default no thresholds are used but when provided if one is hit then an exception will be triggered and rendering will abort.
refs https://github.com/mapbox/tippecanoe/commit/b2eff136675f1340abb794fcd7b016663d981547