MBStyles stops splitting breaks interpolation and increases output style size

Description

The current code splitting a style by one FeatureTypeStyle per zoom stop is breaking interpolation and making the output larger than it needs, at least when there are no "zoom and property" interpolations.

When there is only zoom based stops, using the interpolation function makes the output simpler, and also improves fidelity, as the filtering code just picks the values for the current stop, breaking interpolation (an interpolation of "one stop" does not interpolate anything, just provides a constant value).

So just keeping the style intact when there are only zoom based stops improves things overall.

I'm not sure what to do with the "property and zoom" case, so leaving it as is for the moment. Gut feeling, I believe that a new interpolation function should be included, that does bilinear interpolation on the two axis, zoom and value, but I might be wrong. For the time being, the current code is probably good enough for that case.

Environment

None

Assignee

Andrea Aime

Reporter

Andrea Aime

Triage

None

Components

Fix versions

Priority

Medium
Configure