summaryrefslogtreecommitdiff
path: root/lib/polygon.py
diff options
context:
space:
mode:
authormdroe <mdroe@stsci.edu>2012-06-05 16:37:07 -0400
committermdroe <mdroe@stsci.edu>2012-06-05 16:37:07 -0400
commitacc4e68a93b16832d397ff75bf5328a32094f525 (patch)
tree8f350c5a0a550c53906783db655325eac3e41884 /lib/polygon.py
parent67962ed392034cc221e928b9769e7bf98c9f6afd (diff)
downloadstsci.sphere-acc4e68a93b16832d397ff75bf5328a32094f525.tar.gz
Fix bug with serial intersection where the intersection is null.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/branches/sphere@17203 fe389314-cf27-0410-b35b-8c050e845b92 Former-commit-id: 18f248eb618623cad24c535ad787f818f5c76a09
Diffstat (limited to 'lib/polygon.py')
-rw-r--r--lib/polygon.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/polygon.py b/lib/polygon.py
index 689e272..4270ce6 100644
--- a/lib/polygon.py
+++ b/lib/polygon.py
@@ -631,6 +631,10 @@ class SphericalPolygon(object):
result = copy(polygons[0])
for polygon in polygons[1:]:
result = result.intersection(polygon)
+ # If we have a null intersection already, we don't
+ # need to go any further.
+ if len(result._points) < 3:
+ return result
return result
else:
raise ValueError("method must be 'parallel' or 'serial'")