From f44cd7d0f612a2487a2d6ae1152fd9dcedb00db2 Mon Sep 17 00:00:00 2001 From: atmorling Date: Thu, 12 Dec 2024 22:27:22 +0200 Subject: [PATCH] Clean timestamps from ER geojson in `get_patrol_events` (#358) --- 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)