3.2.2. Extracting Free Spaces Geometry

After locating the AOI in an enclosed form on the map, we extract free spaces geometry from the AOI. To do so, we first perform the obstacles' existence checks in the AOI. With the help of these checks, the AOI can be classified into three categories such as obstacles-free environment, obstacles inhibiting environment and area boundary obstacles only. We simplify the AOI boundary by considering the obstacles that intersect with the AOI edges or vertices and lying in close proximity of the AOI edges by shrinking the AOI inward considering the UAV size.

Those obstacles which are on the boundary of the AOI or in close proximity that can impact the UAV safety are removed and configuration space (CS) is simplified for mission. Later, we draw a line from one vertices of the AOI to its nearest adjacent vertices and rotate it to all *n* vertices to determine the obstacles' existence. If no obstacles intersect with the line, then the AOI can be regarded as the obstacle-free. Meanwhile, if the obstacles exist, the proposed algorithm determines whether the obstacles are part of the area boundary obstacles only or in-field obstacles. In the former case, the proposed algorithm performs the coverage in simplified CS where the AOI is obstacle-free. In the latter case, the obstacles' enlargement (i.e., pushing the intersections by a *Dsaf e* out of obstacles.) and clustering are carried out to extract the free spaces geometry from the AOI. We enlarge the obstacles by safe distance *Dsaf e* and cluster the nearby obstacles which overlap each other due to *Dsaf e* addition or become so close to each other that UAV can collide. *Dsaf e* is an integer number whose value can be adjusted considering the UAV size, operating environment and obstacles shape. A pictorial overview of the enlarged obstacle by *Dsaf e* addition is shown in Figure 4b.

**Figure 4.** Overview of the enlarged obstacle by *Dsaf e* value.

We apply the minimum UAV altitude limits *Hmin* to discard the obstacles that fall below the *Hmin* and UAV can go over safely. Through the above-mentioned process, the AOI can be classified into traversable and non-traversable parts. In the traversal parts, we fit UAV sensor footprints' sweeps considering the appropriate coverage direction for the coverage missions.
