felt/tippecanoe

Alternative to the GeoJSON extension?!

Opened this issue · 1 comments

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:

  • it is only possible with GeoJSON and NDJSON; there is no way to do the same with Shapefiles, Geobuf, FlatGeobuf.
  • for NDJSON it requires me to put the (identical) property on every single features.
  • when I need to change the mapping from grid levels to zoom levels I have to rewrite the inputfiles with an updated tippecanoe property
  • not all GIS-tools support the creation of additional properties on the root of a feature (instead of properties). And I already encountered situations where I have hit buffer size limits with the proposed ndjson-cli (with very very big geometries)

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.

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