Open agoddard opened 3 months ago
The disadvantage to prefilters is that they turn out to be really slow, because all of the tiling threads have to wait for the filter to finish running before they can continue.
I think what I should have done instead is to have made the prefilter and postfilter be a python or node script invoked in an embedded interpreter within the tippecanoe process rather than an external shell script. I never actually started down the road of implementing anything like that, though.
Rather than trying to wedge it into tippecanoe, I would be tempted to do the attribute augmentation as a postprocessing step: iterate through the tiles in a python script or something, mutate the attributes, and write the modified tiles back out.
Within tippecanoe itself, the most straightforward place to mutate the tile would be here, at the point of the existing call to the postfilter, after everything in the tile has been assembled, just before actually encoding it.
Hello! Thanks for all of the incredible work on Tippecanoe! I am looking for ways to augment attributes in pmtiles per-tile and wondering if there's a way to do this already in Tippecanoe? From my understanding it could be similar to a pre filter but where the script that was executed per tile returned data to add as attributes on features. I think a workaround exists where a prefilter script renders a geojson per tile, then this geojson can be augmented and turned back into pmtiles with tippecanoe, but I'm not sure if there's disadvantages to doing it this way.
In terms of an example use-case, lets say there is a highway feature and the highway goes from NYC to LA, I would like to tag the feature with "state" but the value of "state" would change depending on the zoom/tile. If you look at a zoom 14 tile in the middle of Kansas, the attribute would be Kansas, and the tiles in Colorado would change to Colorado, etc. The values would be populated by a third party script executed by the shell script, much like pre filters are.
Is there a way to achieve this today in Tippecanoe?