I have saved string representations of some Shapely Polygons:
'POLYGON ((51.0 3.0, 51.3 3.61, 51.3 3.0, 51.0 3.0))'
Is there some fast way of directly converting it back to the Polygon type? Or do I need to manually parse the strings to create Polygon objects?
Shapely can directly parse this :
import shapely.wkt
P = shapely.wkt.loads('POLYGON ((51.0 3.0, 51.3 3.61, 51.3 3.0, 51.0 3.0))')
print(P)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.