Skip to content

Commit

Permalink
add patrol details
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgitonga authored Sep 15, 2023
1 parent 67dc3c2 commit cc66a26
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ecoscope/io/earthranger.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,10 @@ def get_patrol_observations(
**kwargs
)
if include_patrol_details:
observation["patrol_id"] = patrol["id"]
observation["patrol_serial_number"] = patrol["serial_number"]
observation["patrol_start_time"] = patrol_start_time
observation["patrol_end_time"] = patrol_end_time
observation["patrol_type"] = patrol_type
observation = observation.reset_index().merge(
pd.DataFrame(self.get_patrol_types()).add_prefix("patrol_type__"),
Expand All @@ -723,7 +727,7 @@ def get_patrol_observations(
f"Getting observations for subject_id={subject_id} start_time={patrol_start_time} end_time={patrol_end_time}"
f"failed for: {e}"
)
return ecoscope.base.Relocations(pd.concat(observations))
return ecoscope.base.Relocations(pd.concat(observations)).set_index("id")

def get_patrol_segment_events(
self,
Expand Down

0 comments on commit cc66a26

Please sign in to comment.