Flight Box

box_around_center_line(instrument, altitude_msl, lat0, lon0, azimuth, box_length, box_width, box_name='Line', start_numbering=1, overlap=20, alternate_direction=True, starting_point='center', polygon=None)[source]

Create a series of flight lines around a center line based on the given box dimensions and instrument properties.

Parameters:
  • instrument (object) – An object with a swath_width(altitude_agl) method.

  • altitude_msl (ureg.Quantity) – Flight altitude MSL. Must be a positive length Quantity. Note: this is passed directly to instrument.swath_width() which expects AGL. Over flat terrain near sea level the difference is negligible; for mountainous terrain, consider adjusting for mean terrain elevation.

  • lat0 (float) – Latitude of the box center in decimal degrees (-90 to 90).

  • lon0 (float) – Longitude of the box center in decimal degrees (-180 to 180).

  • azimuth (float) – Orientation of the box in degrees. Will be wrapped to [-180, 180].

  • box_length (ureg.Quantity) – Length of the box as a positive length Quantity.

  • box_width (ureg.Quantity) – Width of the box as a positive length Quantity.

  • box_name (str) – Name prefix for the flight lines.

  • start_numbering (int) – Starting number for flight line naming. Must be a positive integer.

  • overlap (float) – Percentage overlap between adjacent swaths. Must be between 0 and 100.

  • alternate_direction (bool) – Whether to alternate flight line directions.

  • starting_point (str) – Whether to start the first line from the “edge” or “center” of the box.

  • polygon (Optional[Polygon]) – Optional polygon to clip flight lines. Must be valid.

Returns:

A list of generated flight lines.

Return type:

List[flight_line.FlightLine]

Raises:

ValueError – If inputs do not meet validation criteria.

Notes

  • Flight lines are generated around the center of the box, with distances calculated from the centerline.

  • Clipping is applied to each line if a polygon is provided.

box_around_polygon(instrument, altitude_msl, polygon, azimuth=None, box_name='Line', start_numbering=1, overlap=20, alternate_direction=True, clip_to_polygon=True)[source]

Generate flight lines based on either: - The minimum rotated rectangle of a polygon (if azimuth=None) - A rotated rectangle at a specified azimuth (if azimuth is given)

Parameters:
  • instrument (object) – Object with swath_width(altitude_agl) method.

  • altitude_msl (ureg.Quantity) – Flight altitude MSL.

  • polygon (Polygon) – Input polygon to generate flight lines within.

  • azimuth (Optional[float]) – If provided, uses a user-defined azimuth instead of the minimum rotated rectangle.

  • box_name (str) – Prefix for flight line names.

  • start_numbering (int) – Starting number for flight line names.

  • overlap (float) – Overlap percentage between adjacent swaths.

  • alternate_direction (bool) – Whether to alternate flight line directions.

  • clip_to_polygon (bool) – Whether to clip flight lines to the convex hull of the polygon.

  • starting_point (str) – Whether to start the first line from the “edge” or “center”.

Returns:

A list of generated flight lines.

Return type:

List[flight_line.FlightLine]

Raises:

ValueError – If inputs are invalid.

Notes

  • If azimuth is None, the function will automatically compute the minimum rotated rectangle.

  • If azimuth is provided, a rotated rectangle at the given azimuth will be used.