-
-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow style bindings when using the feature rendering cache #6964
Conversation
…ed in msDrawShape
Will definitely take some time to review! |
Regarding legends, it's basically impossible to generate legend icons with bindings because of all the variability and lack of access to features. I think it just punts and returns a blank image. Easy enough to test, just run a mode=legend with your test mapfile. |
@sdlime - when using bindings and legends, any of the bound attributes of the style will use the style defaults defined in initStyle. For example I discussed this pull request briefly with @rouault at the Vienna codesprint - he sees no issues from a coding-side, but is less familiar with the logic around the rendering cache. -- As an aside while debugging I had to comment out the following line as it always returned NULL, even though an Lines 721 to 723 in 990d28e
The |
Yes, this is old and somewhat complicated logic. Caching was mostly related to GD and when that support was yanked. I wonder if some remnants still exist. |
@sdlime the caching here only seems to be relevant to line layers to allow multiple overlain styles, and was added in bcaae2c The GD caching (also in that commit) and using the variable I've been testing this branch for a month with no issues, and if anything arises I'm happy to fix it and add a new test. Any further comments or is it ok to merge this in a few days time? |
+1 on merging... |
Pull request to address the issues raised in #6963.
This adds additional checks to ensure
OUTLINEWIDTH
and road/line casing is applied if attribute binding is used forOUTLINEWIDTH
, and that the correct boundWIDTH
is used for rendering.The approach is to apply the binding before calculating the underlying line style, and then avoid rebinding this to preserve the style in
msDrawVectorLayer
.From initial tests it no longer seems necessary to disable caching when attribute binding is used in subsequent styles.
I added a test for #3976 and removed the check in c63553e that disables caching when
bindings are used for multiple styles. This part can easily be rolled back.
The changes maybe addresses some of the points raised in #3995. I'm unsure how legend creation is meant to work when using attribute binding - if each shape can be rendered differently, what should the legend display?
Reviews and comments very much appreciated as the rendering process is complex!