Created
November 11, 2011 00:00
-
-
Save guziy/1356683 to your computer and use it in GitHub Desktop.
Polygon to matplotlib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
polygon = loads(geom.ExportToWkt()) | |
boundary = polygon.exterior | |
coords = np.zeros(( len(boundary.coords), 2)) | |
for i, the_coord in enumerate(boundary.coords): | |
coords[i, 0], coords[i, 1] = basemap( the_coord[0], the_coord[1] ) | |
result.append(Polygon(coords, facecolor = 'none', edgecolor = edge_color, linewidth = linewidth)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment