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

Adding optional clipping to tippecanoe-overzoom #298

Merged
merged 25 commits into from
Nov 27, 2024
Merged

Adding optional clipping to tippecanoe-overzoom #298

merged 25 commits into from
Nov 27, 2024

Conversation

e-n-f
Copy link
Collaborator

@e-n-f e-n-f commented Nov 19, 2024

This PR adds --clip-bounding-box and --clip-polygon options to tippecanoe-overzoom, to clip the output tile to arbitrary rectangular or polygon bounds.

To accomplish LineString clipping to polygon bounds, it brings back Clipper as a vendored package. Wagyu continues to be used to clip and clean polygons.

@e-n-f e-n-f marked this pull request as ready for review November 26, 2024 23:14
overzoom.cpp Outdated
@@ -67,7 +69,10 @@ int main(int argc, char **argv) {
{"assign-to-bins", required_argument, 0, 'b' & 0x1F},
{"bin-by-id-list", required_argument, 0, 'c' & 0x1F},
{"accumulate-numeric-attributes", required_argument, 0, 'a' & 0x1F},
{"numeric-attributes", required_argument, 0, 'a' & 0x1F},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This looks like a merge conflict accidental edit

}

case 'l' & 0x1F: {
clipbbox clip = parse_clip_poly(optarg);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Clip the clip regions to the tile bounds to speed up the case where complicate bounds entirely enclose the tile.

Copy link

@ChrisLoer ChrisLoer left a comment

Choose a reason for hiding this comment

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

I walked through this with Erica and we tested some usage (although in a pretty limited way) in Felt. Thanks for adding the clipping simplification and associated test!

Copy link

@ChrisLoer ChrisLoer left a comment

Choose a reason for hiding this comment

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

I walked through this with Erica and we tested some usage (although in a pretty limited way) in Felt. Thanks for adding the clipping simplification and associated test!

@e-n-f e-n-f merged commit dcc616d into main Nov 27, 2024
4 checks passed
@e-n-f e-n-f deleted the overzoom-clip branch November 27, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants