Skip to content

Change default repeat_distance for point feature labels#718

Merged
bcamper merged 1 commit intomasterfrom
point-repeat
Jun 9, 2019
Merged

Change default repeat_distance for point feature labels#718
bcamper merged 1 commit intomasterfrom
point-repeat

Conversation

@bcamper
Copy link
Copy Markdown
Member

@bcamper bcamper commented Jun 5, 2019

The default repeat_distance for labels has always been 256px across the board. This is a sensible default for cases such as street labels (the original use case for repeat label culling) and road shields, but can generate unexpected results particularly when applied to point labels.

For example, when labelling data with a property that has a finite set of values, such as category names ("bar", "restaurant", "hardware store", etc.) or numeric values, it's often surprising/undesirable that only a few labels are plotted.

This branch changes this behavior such that:

  • For labels generated from point features, the default repeat_distance is 0px.
  • For all other labels, including those generated from line or polygon features (e.g. street names, road shields, park names, etc.), the default repeat_distance continues to be 256px. Note that in these examples, the labels themselves may still be point labels -- it is the underlying geometry type that matters, e.g. road shields are point labels generated from line geometries.

This example illustrates the difference in point geometry behavior:

        draw:
            points:
                color: red
                size: 4px
                collide: false
                text:
                    text_source: function(){ return 1 }
                    font:
                        color: white
                        stroke: { color: black, width: 4px }

In the prior behavior, only a few point labels are shown, and in the new behavior, all points are rendered:

Webp net-gifmaker

…s originally from point geometries,

continue to use tile size (256px) default for labels for other geometries (lines, polygons)
@bcamper bcamper added this to the v0.19.0 milestone Jun 5, 2019
@bcamper
Copy link
Copy Markdown
Member Author

bcamper commented Jun 5, 2019

@matteblair @meetar @nvkelso we talked about this a few months ago... finally getting around to it.

@nvkelso
Copy link
Copy Markdown
Member

nvkelso commented Jun 6, 2019

LGTM!

Copy link
Copy Markdown
Member

@matteblair matteblair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants