summaryrefslogtreecommitdiff
path: root/lib/polygon.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/polygon.py')
-rw-r--r--lib/polygon.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/polygon.py b/lib/polygon.py
index b20e0b1..e9ad379 100644
--- a/lib/polygon.py
+++ b/lib/polygon.py
@@ -78,12 +78,18 @@ class SphericalPolygon(object):
mean of the points will be used.
"""
if len(points) == 0:
- pass
+ # handle special case of initializing with an empty list of
+ # vertices (ticket #1079).
+ self._inside = np.zeros(3)
+ self._points = np.asanyarray(points)
+ return
elif len(points) < 3:
raise ValueError("Polygon made of too few points")
else:
assert np.array_equal(points[0], points[-1]), 'Polygon is not closed'
+
self._points = np.asanyarray(points)
+
if inside is None:
self._inside = np.mean(points[:-1], axis=0)
else: