airbornegeo.along_track_distance#
- along_track_distance(data, *, groupby_column=None, progressbar=True, guess_start_position=False)[source]#
Calculate the distances along track in meters. This assumes the data has 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 data = data.sort_values([“flight”, “unixtime”]). If groupby_column is provided, the dataframe will first be grouped by this.
- Parameters:
data (
DataFrame) – Dataframe containing the data points to calculate the distance along each line, with columns ‘easting’ and ‘northing’ of projected coordinates. If guess_start_position is True and data doesn’t already have a ‘geometry’ column, one is created from these coordinates.groupby_column (
str|None) – Column name to group by before calculation, by default Noneprogressbar (
bool) – Show progress bar for each group, by default Trueguess_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:
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]