ecoscope.io.earthranger_utils#

Module Contents#

ecoscope.io.earthranger_utils.TIME_COLS = ['time', 'created_at', 'updated_at', 'end_time', 'last_position_date', 'recorded_at', 'fixtime']#
ecoscope.io.earthranger_utils.clean_kwargs(addl_kwargs=None, **kwargs)[source]#
Parameters:

addl_kwargs (dict | None)

Return type:

dict

ecoscope.io.earthranger_utils.normalize_column(df, col)[source]#
Parameters:
  • df (pandas.DataFrame)

  • col (str)

Return type:

None

ecoscope.io.earthranger_utils.dataframe_to_dict_or_list(events)[source]#
Parameters:

events (geopandas.GeoDataFrame | pandas.DataFrame | dict | list[dict])

Return type:

dict | list[dict]

ecoscope.io.earthranger_utils.to_gdf(df)[source]#
Parameters:

df (pandas.DataFrame)

Return type:

geopandas.GeoDataFrame

ecoscope.io.earthranger_utils.clean_time_cols(df)[source]#
Parameters:

df (pandas.DataFrame | geopandas.GeoDataFrame)

Return type:

pandas.DataFrame | geopandas.GeoDataFrame

ecoscope.io.earthranger_utils.format_iso_time(date_string)[source]#
Parameters:

date_string (str)

Return type:

str

ecoscope.io.earthranger_utils.to_hex(val, default='#ff0000')[source]#
Parameters:
  • val (str | None)

  • default (str)

Return type:

str

ecoscope.io.earthranger_utils.pack_columns(dataframe, columns)[source]#

This method would add all extra columns to single column

Parameters:
  • dataframe (pandas.DataFrame)

  • columns (list)

Return type:

pandas.DataFrame

ecoscope.io.earthranger_utils.geometry_from_event_geojson(df, geojson_column='geojson', force_point_geometry=True, drop_null_geometry=True)[source]#
Parameters:
  • df (pandas.DataFrame)

  • geojson_column (str)

  • force_point_geometry (bool)

  • drop_null_geometry (bool)

Return type:

geopandas.GeoDataFrame