Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Compare absolute value of polygon ring area #7621

Merged
merged 1 commit into from
Feb 9, 2017
Merged

Conversation

springmeyer
Copy link
Contributor

@springmeyer springmeyer commented Jan 7, 2017

This PR moves native to match JS which compares unsigned areas when limiting polygon rings (https://github.com/mapbox/mapbox-gl-js/blob/fddba1b48e7e65b821ef7c7c3813f03baa8abf9d/js/util/classify_rings.js#L19)

This is important. Currently we compare signed area which means we incorrectly sort polygons before limiting.

Fixes various rendering issues like the coast of sweden:

Before:

screen shot 2017-01-06 at 6 54 25 pm

After:

screen shot 2017-01-06 at 6 54 54 pm

@springmeyer springmeyer added the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Jan 7, 2017
@mention-bot
Copy link

@springmeyer, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @ansis and @tmpsantos to be potential reviewers.

@springmeyer springmeyer changed the title [TESTING] Compare absolute value of polygon ring area Compare absolute value of polygon ring area Jan 7, 2017
@springmeyer springmeyer added ✓ ready for review and removed ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold labels Jan 7, 2017
@springmeyer springmeyer requested a review from jfirebaugh January 7, 2017 03:13
Copy link
Contributor

@jfirebaugh jfirebaugh left a comment

Choose a reason for hiding this comment

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

Can you please add a test?

@springmeyer
Copy link
Contributor Author

Yes, will plan to work on a testcase. Juggling a few other things right now, so anyone feel free to jump in here to help as well with help on testing.

  - This ensures we actually keep the largest polygons
  - Adds testcase that fails without this patch
@springmeyer
Copy link
Contributor Author

Testcase now in place. I think this is ready to merge /cc @jfirebaugh.

Copy link
Contributor

@jfirebaugh jfirebaugh left a comment

Choose a reason for hiding this comment

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

Thanks @springmeyer!

@jfirebaugh jfirebaugh merged commit 13e5041 into master Feb 9, 2017
@jfirebaugh jfirebaugh deleted the abs-area-compare branch February 9, 2017 16:40
1ec5 added a commit that referenced this pull request Feb 10, 2017
@1ec5 1ec5 mentioned this pull request Feb 10, 2017
@1ec5
Copy link
Contributor

1ec5 commented Feb 10, 2017

Adding this change to the iOS and macOS changelogs in #8011.

1ec5 added a commit that referenced this pull request Feb 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants