mirror of
https://github.com/wassname/geopandas.git
synced 2026-09-10 12:00:21 +08:00
Moved shapely import to top of file in plotting.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user