Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'MultiLineString #93

Open
6287q opened this issue Mar 13, 2024 · 0 comments
Open

'MultiLineString #93

6287q opened this issue Mar 13, 2024 · 0 comments

Comments

@6287q
Copy link

6287q commented Mar 13, 2024

#从中提取其中的到离站轨迹
import shapely
if line_intersection.is_empty:
pass
else:
#将每一次到站信息放入list中
if type(line_intersection) == shapely.geometry.linestring.LineString:
arrive = [line_intersection]
else:
arrive = list(line_intersection)
#构建为DataFrame
arrive = pd.DataFrame(arrive)
#取每一次到离站时间
arrive['arrivetime']= arrive[0].apply(lambda r:r.coords[0][0])
arrive['leavetime']= arrive[0].apply(lambda r:r.coords[-1][0])
arrive

出现错误:'MultiLineString' object is not iterable怎么解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant