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

Change polygons defined with cut lines into disjoint polygons #123

Merged
merged 4 commits into from
Oct 24, 2017
Merged

Change polygons defined with cut lines into disjoint polygons #123

merged 4 commits into from
Oct 24, 2017

Conversation

bernie-simon
Copy link
Contributor

Older versions of spherical_geometry defined disjoint polygons as a single polygon joined by cut lines. When taking the intersection or union between polygons, the first step was to remove thes cut lines. However, when two polygons have a shared edge, the edge looks like a cut line and is removed, causing an error with the intereection and union methods. This fix moves the removal of the cut lines into the initialization of a SphericalPolygon. The single polygon with cut lines is thus transformed into a list of polygons without cut lines. And the initial step of removing cut lines in the union and intersection methods can be removed, which fixes the problem of the spurious removal of the shared edge of two polygons.

Older versions of spherical_geometry defined disjoint polygons as a
single polygon joined by cut lines. When taking the intersection or
union between polygons, the first step was to remove thes cut lines.
However, when two polygons have a shared edge, the edge looks like a
cut line and is removed, causing an error with the intereection and
union methods. This fix moves the removal of the cut lines into the
initialization of a SphericalPolygon. The single polygon with cut
lines is thus transformed into a list of polygons without cut
lines. And the initial step of removing cut lines in the union and
intersection methods can be removed, which fixes the problem of the
spurious removal of the shared edge of two polygons.
The spherical geometry code has been updated to remove cut lines from
polygons, but the difficult test cases bypassed the code in
SphericalGeometry that implements the fix. The test has been updated
to call the new code.
I had deleted a test case from difficult_intersections.txt because it
was causing me problems. But as Shakespeare said, "The fault, dear
Horatio, is not in the stars, but in ourselves." Changing the test
case code, fixed the problem, so I have restored the test case.
As astropy no longer supports python 2.7 and spherical geometry is an
astropy affiliated library, so I have removed python 2.7 test cases
from the test matrix.
@bernie-simon bernie-simon merged commit 3035d3c into spacetelescope:master Oct 24, 2017
@bernie-simon bernie-simon deleted the disjoint_polygons branch October 24, 2017 15:12
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.

1 participant