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

Don't let polygons with nonzero area disappear during cleaning #241

Merged
merged 1 commit into from
May 5, 2016

Conversation

e-n-f
Copy link
Contributor

@e-n-f e-n-f commented May 5, 2016

If they collapse, turn them into placeholder squares with the
appropriate area so that there aren't visible coverage gaps.

If they collapse, turn them into placeholder squares with the
appropriate area so that there aren't visible coverage gaps.
@springmeyer
Copy link
Contributor

springmeyer commented May 5, 2016

Interesting. @flippmoke started throwing these out recently in mapnik-vector-tile and I've also felt like this needed to be able to be an option for keeping small polys for certain visualization needs (mapbox/mapnik-vector-tile#131). @ericfischer can you debrief more on your motivation here and what you think reasonable defaults are?

@e-n-f
Copy link
Contributor Author

e-n-f commented May 5, 2016

@springmeyer Tippecanoe's stated intent has always been that

If you give it all the building footprints in Los Angeles and zoom out far enough that most individual buildings are no longer discernable, you should still be able to see the extent and variety of development in every neighborhood, not just the largest downtown buildings.

Most of the way that I have accomplished this so far is that any polygon whose area is smaller than a pixel will never be drawn directly; instead, the rounding error will be accumulated across the tile until there is at least a pixel worth of "tiny polygon" area that can all be assigned to whichever lucky tiny polygon wins the jackpot and gets to be drawn as a pixel.

This change in this PR is because it turned out that polygons with an area larger than a pixel might still decay to nothing during polygon cleaning if downsampling to the tile grid worked out badly. As the screenshot in #240 shows, this could leave large empty areas where all the polygons decayed badly in the same way, leaving no representative data.

I am not really satisfied with the shapes of the fabricated polygons in either situation. If the "tiny polygons" are adjacent, as in the case of these parcels, really they should be coalesced together rather than approximated with squares. But I don't know any better way to handle tiny polygons that are detached from one another, as building footprints often are. Stretching the area of the "lucky" polygon instead of drawing it as a square does not look good.

So I don't know whether this is necessarily the right policy for Mapnik, but it is the best way I've found so far to approximate a visually continuous experience from each zoom to the next.

@e-n-f e-n-f merged commit f920c05 into master May 5, 2016
@e-n-f e-n-f deleted the save-polygons branch May 5, 2016 21:56
@springmeyer
Copy link
Contributor

Thank you for the explanation @ericfischer

@timiyay
Copy link

timiyay commented May 6, 2016

nice work @ericfischer

Since you've cranked out a few point releases this week, could we please get a Github release for v1.11.4? I'll use it to update the Homebrew formula.

Thanks!

@e-n-f
Copy link
Contributor Author

e-n-f commented May 6, 2016

@timiyay
Copy link

timiyay commented May 7, 2016

Thanks. The Homebrew update is in the pipeline: Homebrew/homebrew-core#944

@e-n-f
Copy link
Contributor Author

e-n-f commented May 9, 2016

Thank you @timiyay!

ewsterrenburg pushed a commit to ewsterrenburg/tippecanoe that referenced this pull request Dec 5, 2024
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