Skip to content

Commit 49d0363

Browse files
committed
Quick fix for #20
1 parent 4fe2cf9 commit 49d0363

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

qgis_processing/qgisUtils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ def tc_from_pt_layer(layer, time_field_name, trajectory_id_field):
2626
for feature in layer.getFeatures():
2727
my_dict = {}
2828
for i, a in enumerate(feature.attributes()):
29-
# QgsMessageLog.logMessage(str(type(a)), "Trajectools", level=Qgis.Info )
30-
if names[i] == time_field_name and type(a) == "QDateTime":
31-
a = a.toPyDateTime()
29+
#QgsMessageLog.logMessage(f"{names[i]} | {time_field_name}", "Trajectools", level=Qgis.Info )
30+
if names[i] == time_field_name: # and type(a) == "QDateTime":
31+
try:
32+
a = a.toPyDateTime()
33+
except:
34+
pass
3235
my_dict[names[i]] = a
3336
pt = feature.geometry().asPoint()
3437
my_dict["geom_x"] = pt.x()

0 commit comments

Comments
 (0)