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(cli): mitigate polygon intersection errors #834

Merged
merged 1 commit into from
Jul 3, 2020

Conversation

jacott
Copy link
Contributor

@jacott jacott commented Jun 28, 2020

Use clipline to reduce polygon when we don't care about degenerate edges. When we do care call
intersection to remove the degenerate edges.

Store image bounds not polygons in SourceMetadata and also store in CogJob. This reduces
floating-point errors when combining source imagery bounds into composite polygons.

Note:

The Martinez polygon-clipping libraries can suffer from errors when lines align. Other intersection
libraries are intractable for the size of coastline polygons. A solution is to call intersection
after first calling clipline.

@jacott jacott force-pushed the fix/cli/mitigate-cutline-problems branch from 8f25066 to 8d2c937 Compare June 28, 2020 21:35
@jacott jacott marked this pull request as draft June 28, 2020 23:03
@jacott jacott force-pushed the fix/cli/mitigate-cutline-problems branch 4 times, most recently from be5f538 to 7cdee44 Compare July 2, 2020 10:45
@lgtm-com
Copy link

lgtm-com bot commented Jul 2, 2020

This pull request introduces 1 alert when merging 7cdee44 into 4c4e155 - view on LGTM.com

new alerts:

  • 1 for Comparison between inconvertible types

@jacott jacott force-pushed the fix/cli/mitigate-cutline-problems branch from 7cdee44 to 7b96808 Compare July 2, 2020 22:31
@jacott jacott marked this pull request as ready for review July 2, 2020 22:33
@lgtm-com
Copy link

lgtm-com bot commented Jul 2, 2020

This pull request introduces 1 alert when merging 7b96808 into 4c4e155 - view on LGTM.com

new alerts:

  • 1 for Comparison between inconvertible types

@jacott jacott force-pushed the fix/cli/mitigate-cutline-problems branch 2 times, most recently from cd33f16 to d998617 Compare July 2, 2020 23:51
packages/cli/src/cog/cog.vrt.ts Show resolved Hide resolved
packages/cli/src/cog/cutline.ts Outdated Show resolved Hide resolved
packages/geo/src/bounds.ts Show resolved Hide resolved
packages/geo/src/bounds.ts Show resolved Hide resolved
packages/shared/src/tms/projection.tile.matrix.set.ts Outdated Show resolved Hide resolved
Use clipline to reduce polygon when we don't care about degenerate edges. When we do care call
intersection to remove the degenerate edges.

Store image bounds not polygons in SourceMetadata and also store in CogJob. This reduces
floating-point errors when combining source imagery bounds into composite polygons.

Note:

The Martinez polygon-clipping libraries can suffer from errors when lines align. Other intersection
libraries are intractable for the size of coastline polygons.  A solution is to call intersection
after first calling clipline.
@jacott jacott force-pushed the fix/cli/mitigate-cutline-problems branch from d998617 to 6c44bdc Compare July 3, 2020 00:47
@jacott jacott requested a review from blacha July 3, 2020 00:51
@kodiakhq kodiakhq bot merged commit 5799137 into master Jul 3, 2020
@kodiakhq kodiakhq bot deleted the fix/cli/mitigate-cutline-problems branch July 3, 2020 01:09
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