Moved shapely import to top of file in plotting.

This commit is contained in:
James McBride
2015-08-11 10:49:15 -07:00
parent 701f051866
commit b3d93bd48d
+1 -1
View File
@@ -3,6 +3,7 @@ from __future__ import print_function
import numpy as np
from six import next
from six.moves import xrange
from shapely.geometry import Polygon
def plot_polygon(ax, poly, facecolor='red', edgecolor='black', alpha=0.5):
@@ -10,7 +11,6 @@ def plot_polygon(ax, poly, facecolor='red', edgecolor='black', alpha=0.5):
from descartes.patch import PolygonPatch
a = np.asarray(poly.exterior)
if poly.has_z:
from shapely.geometry import Polygon
poly = Polygon(zip(*poly.exterior.xy))
# without Descartes, we could make a Patch of exterior