Skip to content

Commit e4d2fb3

Browse files
committed
Better error message
improvement for #23
1 parent 8fcc2ab commit e4d2fb3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

qgis_processing/trajectoriesAlgorithm.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ def create_tc(self, parameters, context):
110110
tc = tc_from_pt_layer(
111111
self.input_layer, self.timestamp_field, self.traj_id_field
112112
)
113+
114+
if len(tc.trajectories) < 1:
115+
raise ValueError(
116+
"The resulting trajectory collection is empty. Check that the trajectory ID and timestamp fields have been configured correctly."
117+
)
118+
113119
tc.add_speed(units=tuple(self.speed_units), overwrite=True)
114120
tc.add_direction(overwrite=True)
115121
return tc, crs

0 commit comments

Comments
 (0)