Skip to content

Commit

Permalink
geojson timestamps should also be cleaned
Browse files Browse the repository at this point in the history
  • Loading branch information
atmorling committed Dec 11, 2024
1 parent f3af43b commit f80185c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ecoscope/io/earthranger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit f80185c

Please sign in to comment.