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

Fix extent warning and clamp exceeding coords #8479

Merged
merged 1 commit into from
Jul 16, 2019
Merged

Fix extent warning and clamp exceeding coords #8479

merged 1 commit into from
Jul 16, 2019

Conversation

mourner
Copy link
Member

@mourner mourner commented Jul 15, 2019

Closes #8477:

  • Fixes the extent warning, for which the threshold wasn't updated to reflect Switch back to a more compact line attributes layout #8306 (we only have 15 bits for the coordinates again).
  • Clamps the coordinates that exceed allowed extent so that when this does happen, it's unlikely to cause any artifacts.

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs no changes
  • post benchmark scores not necessary
  • manually test the debug page

@@ -39,6 +39,8 @@ export default function loadGeometry(feature: VectorTileFeature): Array<Array<Po

if (point.x < bounds.min || point.x > bounds.max || point.y < bounds.min || point.y > bounds.max) {
warnOnce('Geometry exceeds allowed extent, reduce your vector tile buffer size');
point.x = clamp(point.x, bounds.min, bounds.max);
Copy link
Contributor

Choose a reason for hiding this comment

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

Will clamping here change the current behavior (especially with respect to geometries split across tile boundaries? Or is it always broken when points are beyond the bounds?

Copy link
Member Author

@mourner mourner Jul 15, 2019

Choose a reason for hiding this comment

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

It's broken. It's just that the bounds were increased 2x when we switched to bigger line layout, and got back when we reverted that. The clamping at minimum doesn't make things worse, but also often makes things better.

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.

Vector tile line rendering regression
2 participants