diff --git a/ecoscope/io/earthranger.py b/ecoscope/io/earthranger.py index 4549ce58..27d5c9c7 100644 --- a/ecoscope/io/earthranger.py +++ b/ecoscope/io/earthranger.py @@ -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__"), @@ -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,