Swath

generate_swath_polygon(flight_line, sensor, along_precision=100.0, across_precision=10.0, dem_file=None)[source]

Generate a swath polygon for a given flight line and line scanning imager.

Parameters:
  • flight_line (FlightLine) – The flight line object containing geometry and altitude.

  • sensor (LineScanner) – The LineScanner object with field of view (FOV).

  • along_precision (float) – Precision of the interpolation along the flight line in meters.

  • across_precision (float) – Precision of the ray-terrain intersection sampling in meters.

  • dem_file (str, optional) – Path to the DEM file. If None, it will be generated.

Returns:

A Shapely Polygon representing the swath.

Return type:

Polygon

calculate_swath_widths(swath_polygon)[source]

Calculate the minimum, mean, and maximum width of a swath polygon.

Parameters:

swath_polygon (Polygon) – The swath polygon generated for a flight line.

Returns:

A dictionary containing the min, mean, and max widths in meters.

Return type:

dict

export_polygon_to_kml(swath_polygon, kml_filename, name='Swath Polygon')[source]

Export a Shapely polygon to a KML file with an unfilled style using simplekml.

Parameters:
  • swath_polygon (Polygon) – A Shapely Polygon representing the swath.

  • kml_filename (str) – Output KML file path.

  • name (str) – Name for the KML placemark.