You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
I've been playing around with a simplified version of the fontset-duplication.mss test and I noticed something about how zoom level inheritance is being handled by carto. Specifically, it appears that if child rules define zoom levels that inclue either the min or max zoom level then the parent rule has its zoom level range truncated, it is not clear to me if this is intended behavior or not.
My results are based on the following minimal mss:
Based on this mss the parent rule should be defined on zoom levels 2 through 5 which corresponds to <MinScaleDenominator>12500000</MinScaleDenominator> and <MaxScaleDenominator>200000000</MaxScaleDenominator> in the xml output.
If I comment out the child rule with zoom level 2, the relevant xml output looks like:
I think this is correct behavior. Since you can't override Symbolizers, we have to generate a symbolizer for every unique combination of properties. In this case, there should always be four rules, even if you comment out a child rule (in that case, the parent rule gets reduced to just one zoom level).
In that case shouldn't the third example alter the parent rule such that it is defined just for zoom level 2 and zoom level 5? Currently there is no way to translate this to mapnik xml without duplicating the rule so it seems kludgy but this seems like it would be the ideal behavior.
Yeah, ideally. However, Carto uses filter-mode="first" and reorders the rules so that more specific rules are matched before less specific rules in those cases. This is just how Carto deals with this so that Carto doesn't have to create duplicates of these rules.
I'm not completely up to speed on how styles are processed and how the filter-mode is handled since there doesn't seem to be any documentation. From a brief survey of the code in feature_style_processor_impl.hpp it seems like if you are using filter-mode="first" then the processor walks through the if rules in the style until it finds the first if rule where the filter evaluates to true.
As such, if the child rules appear before the parent rule then it shouldn't matter if we truncate the zoom levels or not when using filter-mode="first" since the style processor should never get that far. Is there some case that I am missing?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I've been playing around with a simplified version of the
fontset-duplication.mss
test and I noticed something about how zoom level inheritance is being handled by carto. Specifically, it appears that if child rules define zoom levels that inclue either the min or max zoom level then the parent rule has its zoom level range truncated, it is not clear to me if this is intended behavior or not.My results are based on the following minimal mss:
Based on this mss the parent rule should be defined on zoom levels 2 through 5 which corresponds to
<MinScaleDenominator>12500000</MinScaleDenominator>
and<MaxScaleDenominator>200000000</MaxScaleDenominator>
in the xml output.If I comment out the child rule with zoom level 2, the relevant xml output looks like:
which corresponds to just zoom level 2.
Similarly, commenting out the child rule with zoom level 5 results in the range for zoom level 5
Finally, if the I comment out both child rules at zoom level 2 and 5, the output returns a rule with a range that covers zoom levels 2 through 5.
The text was updated successfully, but these errors were encountered: