felt / tippecanoe

Build vector tilesets from large collections of GeoJSON features.
BSD 2-Clause "Simplified" License
906 stars 78 forks source link

Alternative to the GeoJSON extension?! #169

Open indus opened 9 months ago

indus commented 9 months ago

I'm using tippecanoe quite often to produce mbtiles from grid data (h3 and similar grids). I preprocess all the grid resolutions individually and then use them all as input in a single tippecanoe call (with a lot of the options like simplification, dropping, etc. turned off). To map the preprocessed grid resolutions to zoomlevels I'm currently using the GeoJSON extension.

It works fine but it is not very pleasant for some reasons:

For these reasons I would want to suggest a new option that allows to do get the functionality of the GeoJSON extension (only on file level) with an additional input file, that would look something like this:

<h3myData_meta.json>

{
"h3myData_res3.ndjson": {"minzoom":0, "maxzoom":0, "layer":"h3withMyData"},
"h3myData_res4.ndjson": {"minzoom":1, "maxzoom":1, "layer":"h3withMyData"},
"h3myData_res5.ndjson": {"minzoom":2, "maxzoom":2, "layer":"h3withMyData"},
...
}

... and be applied with a flag like -meta h3myData_meta.json (I'm not sure how to name it):

tippecanoe -o h3myData.mbtiles -meta h3myData_meta.json h3myData_res*.ndjson

This would be possible with all input filetypes, would allow for easy adjustments, and would not require to modify the input itself.

indus commented 9 months ago

Maybe this could be more easily implemented by extending the -L{layer-json} option with the logic from the GeoJSON extension?