So, I discovered the trick is to use a combination of the Polygon
class methods to achieve this.
If you want geodesic coordinates, you then need to transform these back to WGS84 (via pyproj
, matplotlib
's basemap
, or something).
from shapely.geometry import Polygon
#Create polygon from lists of points
x = [list of x vals]
y = [list of y vals]
some_poly = Polygon(x,y)
# Extract the point values that define the perimeter of the polygon
x, y = some_poly.exterior.coords.xy
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…