Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I have a DataFrame where one column consists of lines stored like so:
'[[-7.61, 42.15],[-6.62, 43.16],[-8.9, 41.0],[-9.2, 40.5]]'
Is there an easy way to read these lines directly into shapely LineStrings so I can treat this as a GeoDataFrame?
Actually, I just sorted it out, though I am happy for suggested improvements:
line = '[[-7.61, 42.15],[-6.62, 43.16],[-8.9, 41.0],[-9.2, 40.5]]'
line = LineString(ast.literal_eval(line))
line = LineString(json.loads(text))
Required, but never shown