airbornegeo.along_track_distance#
- along_track_distance(data, *, easting_column='easting', northing_column='northing', groupby_column=None, guess_start_position=False)[source]#
Calculate the distances along track in meters. 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 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, must have a set geometry column.easting_column (
str) – name of the column containing the easting coordinates in metersnorthing_column (
str) – name of the column containing the northing coordinates in metersgroupby_column (
str|None) – Column name to group by before calculation, by default Noneguess_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: