Skip to content
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

[OGR] Legend keys are blank when using STYLEITEM AUTO #26

Closed
mapserver-bot opened this issue Apr 3, 2012 · 6 comments
Closed

[OGR] Legend keys are blank when using STYLEITEM AUTO #26

mapserver-bot opened this issue Apr 3, 2012 · 6 comments

Comments

@mapserver-bot
Copy link

Reporter: dmorissette
Date: 2001/07/16 - 22:30
Trac URL: http://trac.osgeo.org/mapserver/ticket/26

Reported by Matt Wilkie:

> Bug:
> 
> I notice when zooming in that the legend entries sometimes have
> blank keys. At first I though that might be because the feature
> is not visible in the viewable area. However zooming in excessively
> proves that not to be the case.
> 
> It doesn't happen with the other two tab demos, maybe because
> they use fewer tab files.
>
@mapserver-bot
Copy link
Author

Author: dmorissette
Date: 2001/07/16 - 22:31

It's an annoying side-effect, but there isn't much we can do about it
due to the nature of the STYLEITEM AUTO feature.

The legend is draw after the map, and since the layers don't have a
static classification any more, the sample is based on the last feature
from the layer that was drawn with each class... the blanks key in some
cases are likely because no feature from that layer were drawn.

Now, that explains it, but doesn't solve the issue... since there can be
thousands of different colors and styles in a single TAB layer, we can't
do much except perhaps disabling the legend, or having the user specify
a small GIF image to be used as the legend key?  Any idea?

@mapserver-bot
Copy link
Author

Author: dmorissette
Date: 2003/01/03 - 18:46

Excerpt from a mapserver-users thread about this on 2003-01-03:

Oliver Wesp wrote:
> 
> I'm somwhat new to using MapInfo TABs with MapServer. So far I got
> everything up and running. My TABs contain different styles so I'm using
> StyleItem 'AUTO' to render these layers. Works fine except for the
> legend. I like every class to appear on the legend. Is this possible? An
> empty class section doesn't appear in the legend (lack of name-item).
> If I add NAME to my class section one class appears in the legend and
> is randomly rendered with different styles due to the displayed features
> when I zoom into the map.

Daniel Morissette wrote:
>
> ...
>
> I guess we could also modify MapServer so that if you define CLASS
> parameters (colors, etc.) in your layer then those parameters are saved
> and used for the legend icons instead of the current behavior where
> whatever you set in the CLASS object with STYLEITEM AUTO is simply
> ignored and the style of the last object takes precedence.
> 

@mapserver-bot
Copy link
Author

Author: dmorissette
Date: 2003/07/01 - 04:00

Can't be done in 4.0, maybe in 4.1.

@mapserver-bot
Copy link
Author

Author: tamas
Date: 2007/08/25 - 01:21
I'm pretty interested in having a solution on this issue as soon as possible. This behaviour exists in many places out there and the actually rendered output seems to be run time determinated (depending on how the features have been drawn before) that is very frustrating. I bet the most prudent approach is to utilize the OGR datasource level default style as described in http://www.gdal.org/ogr/ogr_feature_style.html. And throw up with the practice to derive the symbology of the legend images from the feature style.

I would also interested in a solution to allow the override of the parameters of the auto style selectively from the mapfile or the mapscript interface.

@mapserver-bot
Copy link
Author

Author: dmorissette
Date: 2007/08/25 - 14:57
Note that the datasource-level style table and default style concepts were just ideas in this document and were never implemented in any driver. Even if we wanted to do it, I'm not sure how the TAB driver could provide a default style for a given .TAB dataset since the source file doesn't contain any info that could be used for that.

With respect to the override of parameters of the auto styles, that should be the topic of another ticket to avoid bloating this ticket with too many issues.

@tbonfort
Copy link
Member

fix would be style caching, which is adressed in #3995 and #3976

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants