Skip to content

Instantly share code, notes, and snippets.

@guziy
Created November 11, 2011 00:00
Show Gist options
  • Save guziy/1356683 to your computer and use it in GitHub Desktop.
Save guziy/1356683 to your computer and use it in GitHub Desktop.
Polygon to matplotlib
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