I noticed slow performance in `getmvt` when generating tiles at zoom levels ~ 0-8.
The issue was due to CASE blocks in the `transportation` and `poi` layers, which were processing unneccessary rows at lower zoom levels. To optimize this I added a pre-filter on `zoom_level` to reduce the workload.
In my tests, I timed the query `select getmvt(0,0,0);`.
`area=europe/united-kingdom`:
* Before: ~17 seconds
* With this fix: ~80 ms
`area=planet`:
* Before: have not yet timed it, but i believe it was around 15min if i remember correctly
* With this fix: ~10 seconds
Co-authored-by: Patrik Sylve <patrik.sylve@t-kartor.com>
This PR adapts the code used in #1457 to allow POIs to render up to z10 for very large features. I set the threshold at a very conservative value of 10% of a tile. Thus, it will render if an area POI covers at least 10% of a tile at a given zoom. Only for 'university' and 'college'.
Additionally, this consolidates a double UNION ALL on the same table with a WHERE/CASE combination, which is simpler.