From f80185c76148926c009bcc22ed7e37eff6cf04fa Mon Sep 17 00:00:00 2001 From: Alex Morling Date: Wed, 11 Dec 2024 13:57:33 +0200 Subject: [PATCH] geojson timestamps should also be cleaned --- ecoscope/io/earthranger.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ecoscope/io/earthranger.py b/ecoscope/io/earthranger.py index 9b935e4a..f15fafce 100644 --- a/ecoscope/io/earthranger.py +++ b/ecoscope/io/earthranger.py @@ -749,11 +749,9 @@ def get_patrol_events( if events_df.empty: return events_df - events_df = clean_time_cols(events_df) events_df["geometry"] = events_df["geojson"].apply(lambda x: shape(x.get("geometry"))) - events_df["time"] = events_df["geojson"].apply( - lambda x: datetime.datetime.strptime(x.get("properties").get("datetime"), "%Y-%m-%dT%H:%M:%S%z") - ) + events_df["time"] = events_df["geojson"].apply(lambda x: x.get("properties").get("datetime")) + events_df = clean_time_cols(events_df) return gpd.GeoDataFrame(events_df, geometry="geometry", crs=4326)