Optimize data preparation, especially for higher zoom levels

This is done adding another filter to the input table scan
using the full grid extent (which is known in advance).
needed str replacements