airbornegeo.along_track_distance

airbornegeo.along_track_distance#

along_track_distance(data, *, groupby_column=None, guess_start_position=False)[source]#

Calculate the distances along track in meters. The dataframe will be grouped by column groupby_column, and the distance will start from the first row of each group. For example, a group can be a survey, a flight, or an individual line. This assumes the data have been sorted by time, and that there are not flights which overlap in time. If there are, you can first sort by flight, then by time. For example, if you have columns ‘flight’ and ‘unixtime’, you can accomplish this with df = df.sort_values([“flight”, “unixtime”]).

Parameters:
  • data (DataFrame | GeoDataFrame) – Dataframe containing the data points to calculate the distance along each line, must have a set geometry column.

  • groupby_column (str | None) – Column name to group by before sorting by time, by default None

  • guess_start_position (bool) – If True, this will determine the start of the line, not by the first row, but by finding the leftmost corner of the line. This is useful if you don’t have a time column and your data is not sorted by time.

Returns:

The along track distance in meters

Return type:

Series