Skip to content

Support for Slope/Elevation-Aware (3D/2.5D) Swath and Route Planning #258

Open

Description

@Nitya-003

Summary

Extend the headland, swath generation, and route planning pipeline to ingest digital elevation models (DEM / 3D contours) so that paths can be optimized for terrain slope, vehicle rollover limits, and soil erosion risk (e.g., following contour lines vs. driving straight up/down slopes).

Problem Statement

Currently, Fields2Cover treats agricultural fields as planar 2D polygons (f2c::types::Field, f2c::types::Cells). In hilly or terraced terrain, planar coverage path planning leads to several real-world issues:

1. Safety & Rollover Risk: Driving across steep cross-slopes increases the risk of vehicle rollover or wheel slip, particularly for heavy machinery (combines, sprayers) with high centers of mass.
2. Soil Erosion: In conservation agriculture, operations must often follow terrain contours rather than straight boustrophedon patterns to prevent runoff channels.
3. Energy Efficiency: Traversing steep gradients vertically consumes significantly more energy/fuel compared to grade-constrained or contour-parallel swaths.
Adding 2.5D/3D awareness directly into the swath generator and route cost objective functions would make Fields2Cover viable for hillside farming, orchards, and terraced vineyards.

Proposed Solution

1. Geometry & Data Structures

  • Update or extend F2CPoint and F2CCells to optionally store elevation data (z), or add an abstraction to sample elevation from a raster/DEM (via GDAL's raster API, which is already a core dependency).
  • Add a Terrain or DEM interface:
namespace f2c {
  class DEM {
  public:
    static DEM importFromRaster(const std::string& path);
    double getElevation(double x, double y) const;
    f2c::types::Point getGradient(double x, double y) const; // returns normal/slope
  };
}

Activity

  1. Gonzalo-Mier commented on Nov 10, 2026

    @Gonzalo-Mier
    Member

    Hi @Nitya-003, welcome to the Fields2Cover project.

    This would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions