Clip with Polygon causes IndexError: list index out of range
See original GitHub issueI am trying to add the clip approach in the 2-ship-data.ipynb notebook by adding below the get_intersecting chunk the following:
all_trajectories = traj_collection.trajectories
arrivals = [ traj.clip(area_of_interest) for traj in all_trajectories ]
And I am getting the following error & I cannot understand why ?
15 if type(row['spatial_intersection']) == LineString: 16 -> pt0 = Point(row['spatial_intersection'].coords[0]) 17 ptn = Point(row['spatial_intersection'].coords[-1]) 18 t = row['prev_t']
IndexError: list index out of range
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Python IndexError: List Index Out of Range [Easy Fix] - Finxter
To solve the “IndexError: list index out of range”, avoid do not access a non-existing list index. For example, my_list[5] causes an error...
Read more >List index out of range error - GIS Stack Exchange
I've been writing a script that clips large datasets based on a ... are active I get the error "Runtime error : list...
Read more >List Index Out of Range – Python Error Message Solved
You'll get the Indexerror: list index out of range error when iterating through a list and trying to access an item that doesn't...
Read more >What is causing this list index out of range error with pandas ...
I'm using 7 functions to create dot density maps in Python, Pandas, and Geopandas. The functions read the US Census blockgroups and create ......
Read more >How to Fix IndexError in Python - Rollbar
This error occurs when an attempt is made to access an item in a list at an index which is out of bounds....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you!! It works fine now.
You’re right. That did the trick. Thank you both for your help!