Flight Lines

class FlightLine[source]

Bases: object

Represents a geospatial flight line with properties, validations, and operations.

Altitude is stored as MSL (above mean sea level), which is the standard aviation reference. Sensor calculations that depend on height above ground (AGL) must account for terrain elevation separately.

__init__(geometry, altitude_msl, site_name=None, site_description=None, investigator=None)[source]
Parameters:
  • geometry (shapely.geometry.LineString)

  • altitude_msl (Quantity)

  • site_name (str | None)

  • site_description (str | None)

  • investigator (str | None)

property lat1
property lon1
property lat2
property lon2
property length: Quantity
property az12: Quantity
property az21: Quantity
property waypoint1: Waypoint
property waypoint2: Waypoint
classmethod start_length_azimuth(lat1, lon1, length, az, **kwargs)[source]
Return type:

FlightLine

Parameters:
classmethod center_length_azimuth(lat, lon, length, az, **kwargs)[source]
Return type:

FlightLine

Parameters:
clip_to_polygon(clip_polygon)[source]

Clip the flight line to a specified polygon.

Parameters:

clip_polygon (Union[Polygon, MultiPolygon]) – The polygon to clip the flight line to.

Returns:

A list of resulting FlightLine(s), or None if no intersection exists.

Return type:

Optional[List[“FlightLine”]]

track(precision=100.0)[source]

Generate a LineString representing the flight line.

Parameters:

precision (Union[Quantity, float]) – Desired distance between interpolated points. Accepts a Quantity with length units or a plain float (assumed meters).

Returns:

A LineString object containing the interpolated track.

Return type:

LineString

reverse()[source]

Reverse the direction of the flight line.

Returns:

A new FlightLine object with reversed direction.

Return type:

FlightLine

offset_north_east(offset_north, offset_east)[source]

Offset the flight line in the north and east directions.

Parameters:
  • offset_north (Quantity) – Distance to offset in the north direction (positive or negative).

  • offset_east (Quantity) – Distance to offset in the east direction (positive or negative).

Returns:

A new FlightLine object with the offset applied.

Return type:

FlightLine

offset_across(offset_distance)[source]

Offset the flight line perpendicular to its direction by a specified distance.

Parameters:

offset_distance (Union[Quantity, float]) – Distance to offset the line (positive for right, negative for left). Plain floats are assumed meters.

Returns:

A new FlightLine object with the offset applied.

Return type:

FlightLine

offset_along(offset_start, offset_end)[source]

Offset the flight line along its direction by modifying the start and end points.

Parameters:
  • offset_start (Union[Quantity, float]) – Distance to offset the start point along the line (positive or negative). Plain floats are assumed meters.

  • offset_end (Union[Quantity, float]) – Distance to offset the end point along the line (positive or negative). Plain floats are assumed meters.

Returns:

A new FlightLine object with the offset applied.

Return type:

FlightLine

rotate_around_midpoint(angle)[source]

Rotate the flight line around its midpoint by a specified angle.

Parameters:

angle (float) – Rotation angle in degrees. Positive values indicate counterclockwise rotation.

Returns:

A new FlightLine object rotated around its midpoint.

Return type:

FlightLine

split_by_length(max_length, gap_length=None)[source]

Split the flight line into segments of a specified maximum length with an optional gap between segments.

Parameters:
  • max_length (Quantity) – Maximum length of each segment (meters).

  • gap_length (Optional[Quantity]) – Length of the gap between segments (meters). Default is None.

Returns:

List of FlightLine objects representing the segments.

Return type:

List[FlightLine]

to_dict()[source]

Convert the flight line to a dictionary representation.

Returns:

Dictionary with keys for geometry coordinates, endpoints,

length (meters), altitude (meters), and metadata fields.

Return type:

Dict

to_geojson()[source]

Convert the flight line to a GeoJSON Feature dictionary.

Returns:

GeoJSON Feature with LineString geometry and properties

including altitude, site name, description, and investigator.

Return type:

Dict

to_gdf(flight_lines, crs='EPSG:4326')[source]

Convert a list of FlightLine objects to a GeoDataFrame.

Parameters:
  • flight_lines (List[FlightLine]) – Flight lines to convert.

  • crs (str) – Coordinate reference system (default: “EPSG:4326”).

Returns:

GeoDataFrame with flight line attributes and geometries.

Return type:

gpd.GeoDataFrame