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

[BUG] Polygon simplification may produce invalid polygons #1965

Closed
JaffaKetchup opened this issue Sep 12, 2024 · 4 comments
Closed

[BUG] Polygon simplification may produce invalid polygons #1965

JaffaKetchup opened this issue Sep 12, 2024 · 4 comments
Assignees
Labels
bug This issue reports broken functionality or another error P: 2 (soon™?) S: core Scoped to the core flutter_map functionality

Comments

@JaffaKetchup
Copy link
Member

What is the bug?

Some Polygons are not simplified correctly, and result in a polygon formed from less than 3 points. This results in long straight lines appearing on the map.

image

How can we reproduce it?

Any polygons which are small enough to be reduced down to less than 3 points should cause the issue.

Do you have a potential solution?

Either avoid displaying polygons with less than 3 points, or prevent the simplification from returning invalid polygons.

Platforms

All

Severity

Obtrusive: Prevents normal functioning but causes no errors in the console

@JaffaKetchup JaffaKetchup added bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing labels Sep 12, 2024
@mootw
Copy link
Contributor

mootw commented Sep 12, 2024

one thing to add is that previously polygon simplification did not create "bad" polygons. Sometimes it makes sense to render long thin polygons as a single line (or even a single point for roughly round shaped polygons!). rendering less polygons can help with performance, but ive found that not rendering polygons of less than 2 leads to a feeling of pop-in, especially with higher simplification values.

@JaffaKetchup JaffaKetchup added P: 2 (soon™?) S: core Scoped to the core flutter_map functionality and removed needs triage This new bug report needs reproducing and prioritizing labels Sep 29, 2024
@mootw mootw self-assigned this Oct 15, 2024
@mootw
Copy link
Contributor

mootw commented Nov 24, 2024

geojson.txt

after some basic testing it seems like the error causes one polygon to have a chunk extend to the next. here is a sample geojson that i have seen the issue with. A few things to note. It is very possible (almost certain) this is not spec compliant. secondly, the error does not occur when simplification is off. I plan to make a reproducible example soon, and also a PR to fix it. I just haven't had the time to do it all right now. One thing that i saw during my limited testing is that it appears to happen when polygons get simplified to less than 3 points. Another thing to note is that it happens with normal polygons and multi-polyons

@mootw
Copy link
Contributor

mootw commented Dec 12, 2024

might be due to flutter sdk?

i was on beta version (3.27), but moved to stable (3.24.5), and now the issue is gone

@mootw
Copy link
Contributor

mootw commented Dec 19, 2024

to the best of my knowledge, this appears to be a flutter sdk issue. There are lots of new issues being tracked related to 3.27, specifically due to crashes and rendering bugs. I am going to close the issue in flutter map, as i believe it is the flutter SDK causing these artifacts. They appear entirely gone immediately after switching to 3.24.5 stable with zero code changes

example here: flutter/flutter#160522

@mootw mootw closed this as completed Dec 19, 2024
@github-project-automation github-project-automation bot moved this from To do to Done in Development Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue reports broken functionality or another error P: 2 (soon™?) S: core Scoped to the core flutter_map functionality
Projects
Status: Done
Development

No branches or pull requests

2 participants