Collision Detection for UAVs Based on GeoSOT-3D Grids

: The increasing number of unmanned aerial vehicles (UAVs) has led to challenges related to solving the collision problem to ensure air tra ﬃ c safety. The traditional approaches employed for collision detection su ﬀ er from two main drawbacks: ﬁrst, the computational burden of a pairwise calculation increases exponentially with an increasing number of spatial entities; second, existing grid-based approaches are unsuitable for complicated scenarios with a large number of objects moving at high speeds. In the proposed model, we ﬁrst identiﬁed UAVs and other spatial objects with GeoSOT-3D grids. Second, the nonrelational spatial database was initialized with a multitable strategy, and spatiotemporal data were inserted with the GeoSOT-3D grid codes as the primary key. Third, the collision detection procedure was transformed from a pairwise calculation to a multilevel query. Four simulation experiments were conducted to verify the feasibility and e ﬃ ciency of the proposed collision detection model for UAVs in di ﬀ erent environments. The results also indicated that 64 m GeoSOT-3D grids are the most suitable basic grid size, and the reduction in the time consumption compared with traditional methods reached approximately 50–80% in di ﬀ erent scenarios.


Introduction
Over the last decade, unmanned aerial vehicles (UAVs) have been utilized in a wide range of military and civilian applications, including surveillance [1,2], monitoring [3,4], imaging [5,6], and reconnaissance [7].UAVs boast many advantages, including remarkable flexibility, low energy consumption, high efficiency and the capacity for real-time monitoring.The increasing number of UAVs, however, has led to challenges related to solving the collision problem to ensure air traffic safety.
Traditionally, two categories of approaches have been employed for collision detection.The first category includes simple collision detection methods based mainly on sensing technologies, such as automatic dependent surveillance-broadcast (ADS-B) technology, visual sensors, optical flow, radar, and light detection and ranging (LiDAR), to alter the course of a flying vehicle toward another direction in the short term to avoid collisions.For example, Scherer et al. and Achtelik et al. employed laser scanners on UAVs to detect obstacles [8,9].Bryson et al. presented the ongoing design and implementation of a robust inertial sensor-based simultaneous localization and mapping (SLAM) algorithm with bearing-only observations [10].Gronzka used a multilevel SLAM algorithm with estimates of aircraft motion and altitude for three-dimensional (3D) mapping, positioning, and navigation [11].Sabatini et al.'s research provided an obstacle detection solution especially suitable for low-altitude UAVs with the remarkable angular resolution and accuracy of LiDAR [12].Becker and Bouabdallah [13] employed four ultrasound sensors for collision detection and a camera system based on above-ground optical flow computations for positioning.However, the abovementioned methods can be ineffective under poor lighting conditions, such as smoke and fog, and they are unable to detect certain objects composed of transparent or signal-absorbing materials.Moreover, it is challenging for these methods to develop a flight plan ahead of time.
The second category of collision detection approaches is based on global or relative positioning, i.e., the coordinates of UAVs and obstacles within the airspace.These positions are acquired either by global continuous positioning systems such as the Global Positioning System (GPS) and Beidou or by obtaining exact indoor location information with Wi-Fi [14] or beacons (Bluetooth Low Energy, BLE) [15].Fiorini and Shiller presented a computationally efficient heuristic approach applicable to the online planning of UAVs [16].Nordlund et al. proposed a probabilistic method designed for noncooperative collision avoidance [17].Several optimization-based schemes focus on solving optimization problems either deterministically or in a probabilistic setting, often in a centralized way, as exemplified in [18,19].Martin and Alan integrated a triaxial magnetometer aiding sensor into an extended Kalman filter (EKF)-based navigation and collision avoidance algorithm [20].However, coordinate-based conflict detection suffers from high computational complexity, especially in the context of a highly dynamic environment with a large data volume.In addition, resolving one conflict may introduce new conflicts into the trajectory, further increasing the computational requirements of conflict detection algorithms [21].
Multidimensional grids provide another viewpoint for UAV conflict detection.Grid-based conflict detection algorithms have been proven to be more computationally efficient than existing algorithms because they eliminate the need for pairwise computations of interaircraft distances.In 2003, Jardin applied a three-dimensional grid (two horizontal spatial dimensions and one time dimension) to real-time conflict-free trajectory optimization [22], and in 2005, Jardin extended the theory to four dimensions [23,24].The grid concept was subsequently implemented as a data structure to enable conflict data integration and solution space visualization [25].Kushleyev et al. conducted an experiment with 16 microquadrotors operating autonomously with an external localization system possessing two-dimensional (2D) grids [26].Spatial grids were further employed for indoor UAV collective motion control experiments [27][28][29].
Previous studies on UAV collision detection suffered from two main drawbacks.First, in most traditional studies, pairwise calculations must be performed on the spatial coordinates acquired from either airborne or satellite sensors.However, directly calculating the values of the equations of space curves using analytical expressions will constitute an enormous computational burden.Potential conflicts with air traffic need to be considered, and it is also important to consider other factors, such as terrain and weather, when performing collision detection.Second, the existing grid-based approaches were mostly restricted within a confined airspace, and the scenarios of their applications were relatively simple.When dealing with collision detection issues under complex and high-speed conditions with multiple spatial entities, the aforementioned grid-based approaches lacked a comprehensive and unified computation system.Moreover, the improved computational efficiency of grid-based methods is accompanied by a certain increase in the computer memory requirement.Therefore, with the sharp increase in the number of aircrafts and the expansion of the scope of their applications, it is highly important to develop an efficient UAV collision detection approach capable of adapting to complex scenes.
A number of recent studies on global grid systems have provided opportunities for geospatial data integration, retrieval, and reference [30,31].Discrete global grid systems (DGGSs) are being increasingly utilized for the creation of such grid systems.DGGSs are a discretization of the Earth into hierarchical sets of highly regular grids, each of which represents a distinct region of the Earth to which data may be assigned [30,32].In this research, we referred to geographical coordinate subdividing grid with one-dimension integer coding on a 2 n tree in three dimensions (GeoSOT-3D) theory to construct the basic spatial reference framework.GeoSOT-3D has been widely studied in various fields, including spatial data reintegration [32,33], database indexing [34,35], risk analysis for natural gas pipelines [36], building information modeling (BIM) data visualization [37], remote sensing data management [38], and city component identification [39].The applications of GeoSOT-3D theory have demonstrated its importance and suitability for highly efficient and accurate spatial data processing and management endeavors.
Referring to the idea of DGGSs in this paper, we adopted the detection of UAV collisions as the optimal problem and adapted a GeoSOT-3D grid-based system to coordinate multi-UAV flights.In our approach, we first established a unified spatial grid subdivision system for the studied airspace and mapped the spatial and temporal information of the UAVs and other spatial entities onto different grids.Second, we applied GeoSOT-3D codes to multilevel spatiotemporal indexing to store spatial information in a spatial database.Finally, the multilevel massive data query engine was shown to support the implementation of multiple processes with high concurrency and massive amounts of data.The proposed method not only provides a powerful means for real-time UAV collision detection but also maximizes airspace utilization through effective management and control while ensuring security.

GeoSOT-3D Grid System
The GeoSOT-3D grid system proposed for this study is a universal and hierarchical three-dimensional geospatial reference system [40].By subdividing the Earth through three iterations (initially expanding the Earth (180 • × 360 • ) into 512 • × 512 • grids, then expanding each 1 • into 64 , and finally expanding each 1 into 64"), two-dimensional quadtree subdivisions at the degree, minute, and second levels are obtained.GeoSOT-3D is congruent and aligned: the largest subdivision grid in the highest level (Level 0) can represent the entire Earth surface, while the smallest subdivision grid in the lowest level (Level 32) can represent the centimeter scale.
Based on our previous work, we extended the two-dimensional global subdivision framework into a third spatial dimension: the elevation dimension.The division of the elevation dimension is directly adopted through a dichotomy.The entire range over which the elevation dimension is divided spans from the geocentric position to 50,000 km above sea level.In this way, this GeoSOT-3D grid system not only possesses global multidimensional octree hierarchical characteristics but also maintains consistency with different types of applications.With an octree-like structure, the GeoSOT-3D coding exhibits three-dimensional components.The node index that branches out from the top level is determined by a formula that uses bits to characterize the longitude, latitude, and altitude within the former node's space.The digit is either 0 or 1 at each level in one dimension; therefore, a digit ranging in value from 0 to 7 can be applied to represent one code at each level by occupying 3 bits.The next (lower) level inherits the digit from the former digit, and an identical formulation is repeated.In this research, if grid A is spatially contained by grid B , we claimed grid A as the parent grid and grid B as the child grid.The Level-2 GeoSOT-3D grid system is illustrated in Figure 1.To better explain the grid code structure, we did not present the actual three-dimensional forms.There are 64 three-dimensional grids (2 3 *2 3 = 64), and the corresponding codes are marked on the regular cubic faces, which are also shown on the four cross-section planes.The corresponding binary codes were listed for the front side, the right side, and the four layers for reference.The Z-order coding scheme maps multidimensional data into one dimension while preserving the locality of the original data.In each code, every bit belongs to a certain dimension and has dichotomous implications.To elaborate, we highlighted the binary bit with the same values in one group to demonstrate that the data of a certain side or layer are determined only by specific binary bits.ISPRS Int.J. Geo

Multilevel Spatiotemporal Indexing
The studied airspace comprises different categories of information (e.g., other aircraft and weather conditions).Each spatial entity is represented by one or more GeoSOT-3D grids according to the occupied grids.The measurement errors of the positions of moving targets such as UAVs exist due to a large number of spatial perturbations (including the atmosphere, illumination, and gravity) and the control ability.When there is only absolute position information at the sampling time without considering measurement error, missing or mistaken selections may arise in the process of mapping the moving objects and computing their mutual relations.Therefore, the modeling of spatial objects should consider not only the spatial location of the object but also the small-scale space surrounding the object.Therefore, the basic partitioning unit under the three-dimensional framework is the subdivision grid; that is, all three-dimensional spatial objects are composed of one or more subdivision grids, as indicated in Figure 2.
The spatiotemporal information of the object is recorded by spatiotemporal coding corresponding to a certain spatial region and time range.The primary keys of data tables are initialized according to the experimental airspace.Sorted spatial grid codes are associated with spatial grids with unique characteristics; therefore, they are adopted as the primary key of the spatial database.We reduce the sorting time by using the prebuilt fixed table structure.In the simplest case, when there is an object in one spatial grid, the record of the corresponding code is 1; otherwise, it is 0. Temporal information is also recorded in each row of the database with a start time stamp and an end time stamp, indicating which objects have been in the space within that time.Thus, we simplify complex pairwise calculation problems into a spatial database query problem.In our experiment, we chose nonrelational databases to store spatial data with multiple tables.Other than the temporal and spatial information, each row of data records various types of information, such as categories, data sources, and physical attributes of the original data.The overall table structure is stable, and the row size of the table does not change, which is suitable for the complex scenes of dynamic objects in space.

Multilevel Spatiotemporal Indexing
The studied airspace comprises different categories of information (e.g., other aircraft and weather conditions).Each spatial entity is represented by one or more GeoSOT-3D grids according to the occupied grids.The measurement errors of the positions of moving targets such as UAVs exist due to a large number of spatial perturbations (including the atmosphere, illumination, and gravity) and the control ability.When there is only absolute position information at the sampling time without considering measurement error, missing or mistaken selections may arise in the process of mapping the moving objects and computing their mutual relations.Therefore, the modeling of spatial objects should consider not only the spatial location of the object but also the small-scale space surrounding the object.Therefore, the basic partitioning unit under the three-dimensional framework is the subdivision grid; that is, all three-dimensional spatial objects are composed of one or more subdivision grids, as indicated in Figure 2. The grid-based method can be further advanced with a UAV management table (c).In the table, the GeoSOT-3D code is set as the primary key, and the collision can be detected by a straightforward query.
One of the great advantages of the GeoSOT-3D grid-based collision detection technique is the ability to filter out redundant calculations with multilevel queries.To meet the needs of a multilevel query, we designed the multitable strategy shown in Figure 3.More than one data table is available to manage and record the UAVs' information in a specific airspace.The primary key of the data table is a spatial code at a certain level that uniquely corresponds to a certain space in the actual threedimensional grid system.Each table stores only the data corresponding to the encoding of a certain The grid-based method can be further advanced with a UAV management table (c).In the table, the GeoSOT-3D code is set as the primary key, and the collision can be detected by a straightforward query.
The spatiotemporal information of the object is recorded by spatiotemporal coding corresponding to a certain spatial region and time range.The primary keys of data tables are initialized according to the experimental airspace.Sorted spatial grid codes are associated with spatial grids with unique characteristics; therefore, they are adopted as the primary key of the spatial database.We reduce the sorting time by using the prebuilt fixed table structure.In the simplest case, when there is an object in one spatial grid, the record of the corresponding code is 1; otherwise, it is 0. Temporal information is also recorded in each row of the database with a start time stamp and an end time stamp, indicating which objects have been in the space within that time.Thus, we simplify complex pairwise calculation problems into a spatial database query problem.In our experiment, we chose nonrelational databases to store spatial data with multiple tables.Other than the temporal and spatial information, each row of data records various types of information, such as categories, data sources, and physical attributes of the original data.The overall table structure is stable, and the row size of the table does not change, which is suitable for the complex scenes of dynamic objects in space.
One of the great advantages of the GeoSOT-3D grid-based collision detection technique is the ability to filter out redundant calculations with multilevel queries.To meet the needs of a multilevel query, we designed the multitable strategy shown in Figure 3.More than one data table is available to manage and record the UAVs' information in a specific airspace.The primary key of the data table is a spatial code at a certain level that uniquely corresponds to a certain space in the actual three-dimensional grid system.Each table stores only the data corresponding to the encoding of a certain level.Each parent code retains a pointer to the data table in which the next level of the child code is located.In this way, after the parent code is queried, if a further detailed query is needed, it can directly link to the data table where the child code is located.At the same time, the sizes of the tables can be kept constant, which is suitable for distributed management; this approach maintains load balancing and efficiency when dealing with the requirements of immense data volumes and high concurrency.There are a number of data tables in the nonrelational database.Each data table records spatiotemporal data at a specific subdivision level.Records at higher levels preserve pointers to the data table at lower levels.The GeoSOT-3D grid code is set as the primary key for each table.Temporal information is also recorded corresponding to each GeoSOT-3D code.

Multilevel Query Methods
In this framework, we conducted collision detection by using a multilevel query method.In previous studies, a conflict was detected when two entities (e.g., aircrafts) were in the same cell.We improved the previous coding systems into a hierarchical system, in which the query operation is not limited to one level.In the collision detection process, each code has the child code or father code, and codes at different levels are calculated.The new data, such as UAV trajectory data, and obstacle There are a number of data tables in the nonrelational database.Each data table records spatiotemporal data at a specific subdivision level.Records at higher levels preserve pointers to the data table at lower levels.The GeoSOT-3D grid code is set as the primary key for each table.Temporal information is also recorded corresponding to each GeoSOT-3D code.
Each spatial object, such as a UAV, corresponds to different spatial grid codes on different spatial scales.Generally, one data table stores only information on a certain scale.Tables with different levels may record one entity's spatiotemporal information.This strategy reduces the burden on each data table because the spatiotemporal information is assigned to multiple tables; in addition, this strategy is suitable for high-concurrency multiprocess queries at the backend.
In this framework, a conflict may occur when the planned route of a UAV passes through a spatial grid that is occupied by another object (either a UAV or another obstacle).The GeoSOT-3D grids were coded in an octree structure, preserving the locality of the original spatial data.Thus, two spatially close grids have partially matching codes from the beginning.In contrast, two distant grids would have codes with different digits from the beginning.Objects that are unlikely to collide with each other are directly screened out because their corresponding spatial codes are not close, and thus, no further operations are required.

Multilevel Query Methods
In this framework, we conducted collision detection by using a multilevel query method.In previous studies, a conflict was detected when two entities (e.g., aircrafts) were in the same cell.We improved the previous coding systems into a hierarchical system, in which the query operation is not limited to one level.In the collision detection process, each code has the child code or father code, and codes at different levels are calculated.The new data, such as UAV trajectory data, and obstacle data should also be inserted after being transformed into GeoSOT-3D codes.In this way, the computational redundancy is reduced significantly.After a collision is detected, the new codes representing UAV trajectories or obstacles are inserted as new columns instead of new rows.
Collision detection for a single grid is shown in Figure 4. We first assumed a grid is present with a code of Code A at level N over a time interval of [T A ,T A '].The codes are stored in data tables relating to higher or equal levels from 0 to N.Then, the data level variable i starts to loop from 0 to N-1.At each level i, we need to obtain the parent code Fa(Code A )i of Code A and check the database to determine whether the corresponding row is null.If there are no data and no neighboring data, we can break the loop for the multilevel insert.If a data record already exists but is not included or adjacent to the time interval of [T A ,T A '], the loop is also skipped, and the next step is composed of the multilevel insert.If the loop reaches level N, the method described above can be applied to determine the grid's relationship: intersecting, neighboring, or disjoint.
If the grid contains an intersecting relationship, two objects will share the same space at the same time, which would probably lead to a collision.If the grid contains an adjacent relationship, there is a risk of collision to a certain degree.Finally, if the grid contains a disjoint relation, there is no risk of collision.The parallel insert operation consists of inserting the parent code of Code A at levels from 0 to N-1 within the time interval [T A ,T A '].
The spatiotemporal collision detection process for multiple grids is shown in Figure 5.We assumed that several spatiotemporal grids are present; each grid corresponds to a spatial grid code Code A and time interval [T A ,T A '], and the lowest-level space code is set as N.The collection of the spatiotemporal grid is recorded as {Code A , [T A ,T A ']}.For each individual grid, we obtain the parent grid codes on levels from 0 to N-1, and the time records are also retained.Thus, several spatial grid codes can be stored at one level, and one spatial grid code may have several corresponding time interval records.The level variable i loops from level 0 to level N-1.For all spatial grid codes at level i with the corresponding time interval [T A ,T A '], if it is null, the condition for the data insert operation is satisfied; otherwise, the collision conditions should be examined individually according to the previous formula, and the collision-free grids with their child grid codes should be removed.When the variable i reaches N, we should make one-to-one judgments with each existing grid code.If any of them intersect with Code A , the result is a collision.If it is an adjacent relationship, there is a risk of collision.If it is a disjoint relationship, there is no risk.When the last subprocesses all satisfy the insert conditions, the multilevel data can be inserted into the multilevel data tables in parallel.The spatiotemporal collision detection process for multiple grids is shown in Figure 5.We assumed that several spatiotemporal grids are present; each grid corresponds to a spatial grid code CodeA and time interval [TA,TA'], and the lowest-level space code is set as N.The collection of the spatiotemporal grid is recorded as {CodeA, [TA,TA']}.For each individual grid, we obtain the parent grid codes on levels from 0 to N-1, and the time records are also retained.Thus, several spatial grid codes can be stored at one level, and one spatial grid code may have several corresponding time interval records.The level variable i loops from level 0 to level N-1.For all spatial grid codes at level i with the corresponding time interval [TA,TA'], if it is null, the condition for the data insert operation is satisfied; otherwise, the collision conditions should be examined individually according to the previous formula, and the collision-free grids with their child grid codes should be removed.When the variable i reaches N, we should make one-to-one judgments with each existing grid code.If any of them intersect with CodeA, the result is a collision.If it is an adjacent relationship, there is a risk of collision.If it is a disjoint relationship, there is no risk.When the last subprocesses all satisfy the insert conditions, the multilevel data can be inserted into the multilevel data tables in parallel.

The spatiotemporal collision avoidance technique utilizing spatial subdivision grids has the following advantages:
1) The octree structure of the space reduces the number of comparisons, thereby filtering out many codes that need no further consideration and greatly improving the comparison efficiency; 2) Multiple operations are required to obtain the parent code at all levels in the operation flow, but the operations to obtain the parent code are simple and need only to be shifted; 3) Multilevel storage enables the parallel insertion of different large tables without the insertion of once table affecting that of another, which improves the insertion efficiency; 4) Temporal and spatial data are stored in a table with spatial codes, avoiding the requirement for multiple indexes and simplifying the detection procedure.The spatiotemporal collision avoidance technique utilizing spatial subdivision grids has the following advantages: 1) The octree structure of the space reduces the number of comparisons, thereby filtering out many codes that need no further consideration and greatly improving the comparison efficiency; 2) Multiple operations are required to obtain the parent code at all levels in the operation flow, but the operations to obtain the parent code are simple and need only to be shifted; 3) Multilevel storage enables the parallel insertion of different large tables without the insertion of once table affecting that of another, which improves the insertion efficiency; 4) Temporal and spatial data are stored in a table with spatial codes, avoiding the requirement for multiple indexes and simplifying the detection procedure.

Experiments
Based on the proposed model, four flight simulation experiments were carried out using the simulation data to prove the feasibility and efficiency of the proposed collision detection model for UAVs in different environments.The first experiment aimed to identify the most appropriate level for UAV collision detection.The second experiment was conducted to evaluate the computational efficiency of the collision detection procedure among three different methods in an airspace without any other obstacles.The third experiment was the same as the second experiment, but other obstacles were also present within the airspace.The last experiment was a UAV formation flight simulation experiment in a dynamic scenario with formation optimization.The experiments were conducted on a personal computer with an Intel(R) Core(TM) i5-4200M CPU @ 2.50 GHz 2.49 GHz and a 16.0 GB memory space.

The Appropriate Level of Identification for UAV Collision Detection
We aimed to find a suitable grid size for managing the formation.If the selected grid is too small, each UAV may require more than one grid for representation; if the grid is too large, false alarms will be induced.The collision detection calculation between two UAVs involves multiple grid comparison algorithms, which will be time consuming.If the selected grid is too large, the two UAVs may still be considered to collide; otherwise, the neighbor may need to be judged to be further away when the distance is great.This kind of grid might also lead to a low efficiency.An optimal grid size can balance these two costs.In the simulation experiment, the basic temporal resolution was 1 s, and the minimum bounding box size of the UAV was 20 m × 20 m × 20 m.The average flight speed of the UAV was 300 km/h (83 m/s) with a variance of 30 km/s; thus, the spatial displacement was approximately 80 m/s.For classification according to size, we can refer to the U.S. Army Roadmap for UAS 2010-2035.The UAV in our simulation experiment can be categorized as a "large" UAV [41].The positions, flying directions, and speeds of the UAVs can be acquired at each time, and the flying directions and speeds vary randomly within a small range.Once a collision was detected, the aircraft turned to another direction and continued to fly.The airspace was a cube that is 5 km × 5 km in area and 15-20 km in height.The UAVs fly in an unconstrained way throughout the airspace and are detected for collisions in real time.This section compares the simulation results under different conditions to determine the size of the GeoSOT-3D grid code that is the most suitable for collision detection.The experimental results are shown in Figure 6.According to the size of the UAVs, the suitable grid sizes were restricted to 128 m, 64 m, and 32 m, which correspond to levels 20, 21, and 22, respectively.In Figure 6, the horizontal axis represents the total number of UAVs, and the vertical axis represents the total time taken to detect collisions for all drones.We tested the time required for detection for numbers of UAVs ranging from 100 to 1000.The time consumed for the 32 m GeoSOT-3D grids and 128 m GeoSOT-3D grids were similar, and both were greater than that for the 64 m GeoSOT-3D grids, indicating that the 64 m grid code results in the best performance.
experiment in a dynamic scenario with formation optimization.The experiments were conducted on a personal computer with an Intel(R) Core(TM) i5-4200M CPU @ 2.50 GHz 2.49 GHz and a 16.0 GB memory space.

The Appropriate Level of Identification for UAV Collision Detection
We aimed to find a suitable grid size for managing the formation.If the selected grid is too small, each UAV may require more than one grid for representation; if the grid is too large, false alarms will be induced.The collision detection calculation between two UAVs involves multiple grid comparison algorithms, which will be time consuming.If the selected grid is too large, the two UAVs may still be considered to collide; otherwise, the neighbor may need to be judged to be further away when the distance is great.This kind of grid might also lead to a low efficiency.An optimal grid size can balance these two costs.In the simulation experiment, the basic temporal resolution was 1 second, and the minimum bounding box size of the UAV was 20 m × 20 m × 20 m.The average flight speed of the UAV was 300 km/h (83 m/s) with a variance of 30 km/s; thus, the spatial displacement was approximately 80 m/s.For classification according to size, we can refer to the U.S. Army Roadmap for UAS 2010-2035.The UAV in our simulation experiment can be categorized as a "large" UAV [41].The positions, flying directions, and speeds of the UAVs can be acquired at each time, and the flying directions and speeds vary randomly within a small range.Once a collision was detected, the aircraft turned to another direction and continued to fly.The airspace was a cube that is 5 km × 5 km in area and 15-20 km in height.The UAVs fly in an unconstrained way throughout the airspace and are detected for collisions in real time.This section compares the simulation results under different conditions to determine the size of the GeoSOT-3D grid code that is the most suitable for collision detection.The experimental results are shown in Figure 6.According to the size of the UAVs, the suitable grid sizes were restricted to 128 m, 64 m, and 32 m, which correspond to levels 20, 21, and 22, respectively.In Figure 6, the horizontal axis represents the total number of UAVs, and the vertical axis represents the total time taken to detect collisions for all drones.We tested the time required for detection for numbers of UAVs ranging from 100 to 1000.The time consumed for the 32 m GeoSOT-3D grids and 128 m GeoSOT-3D grids were similar, and both were greater than that for the 64 m GeoSOT-3D grids, indicating that the 64 m grid code results in the best performance.

Evaluation of the Computational Efficiencies of Three Methods in an Obstacle-Free Airspace
After we selected the 64 m GeoSOT-3D grid as the basic grid size, we designed further experiments to evaluate the time consumed by the collision detection with three-dimensional coordinates, 64 m simple grids and 64 m GeoSOT-3D grids.Collision detection with three-dimensional coordinates is based on the pairwise calculation approach, in which the collision is detected by computing the Euclidean distance between every two UAVs and comparing the calculated distance with the threshold (UAV size).Collision detection with simple 64 m grids is based on traversing the grids and identifying whether there is more than one UAV in a GeoSOT-3D grid.Collision detection with 64 m GeoSOT-3D grids, namely, our proposed method, employs 64 m grids as the basic grids.Figure 7 displays the results of our simulated UAV formation flight.The experimental conditions were the same as those in the previous experiment, and the number of UAVs ranged from 100 to 1000.We find that, when the quantity of UAVs was less than 300, the three methods displayed similar performance; however, as the quantity of UAVs increased, the calculation times of the two grid methods were better than that of the method based on three-dimensional coordinates.Moreover, the method based on 64 m GeoSOT-3D grids was superior to that based on simple 64 m grids.For large numbers of UAVs, the proposed method can reduce the time consumption by up to approximately 80%.
dimensional coordinates is based on the pairwise calculation approach, in which the collision is detected by computing the Euclidean distance between every two UAVs and comparing the calculated distance with the threshold (UAV size).Collision detection with simple 64 m grids is based on traversing the grids and identifying whether there is more than one UAV in a GeoSOT-3D grid.Collision detection with m GeoSOT-3D grids, namely, our proposed method, employs 64 m grids as the basic grids.Figure 7 displays the results of our simulated UAV formation flight.The experimental conditions were the same as those in the previous experiment, and the number of UAVs ranged from 100 to 1000.We find that, when the quantity of UAVs was less than 300, the three methods displayed similar performance; however, as the quantity of UAVs increased, the calculation times of the two grid methods were better than that of the method based on three-dimensional coordinates.Moreover, the method based on 64 m GeoSOT-3D grids was superior to that based on simple 64 m grids.For large numbers of UAVs, the proposed method can reduce the time consumption by up to approximately 80%.

Evaluation of the Computational Efficiencies of Three Methods in an Airspace with Obstacles
Conflicts may occur, not only between UAVs but also between a UAV and another aircraft or adverse weather conditions.Hence, it is fairly straightforward to extend the proposed system to include available information on other types of conflicts.When a UAV passes through a GeoSOT-3D grid that is occupied by another spatial object, the situation is processed in the same way as a conflict between UAVs.

Evaluation of the Computational Efficiencies of Three Methods in an Airspace with Obstacles
Conflicts may occur, not only between UAVs but also between a UAV and another aircraft or adverse weather conditions.Hence, it is fairly straightforward to extend the proposed system to include available information on other types of conflicts.When a UAV passes through a GeoSOT-3D grid that is occupied by another spatial object, the situation is processed in the same way as a conflict between UAVs.
Figure 8 displays the results of another simulated UAV formation flight.Different from the previous experiments, a 1 km × 1 km × 1 km obstacle was placed at the center of the airspace, and the experimental results are shown in subfigure (a).In addition, 100 obstacles of the same size as the UAVs were placed within the airspace, and the experimental results are shown in subfigure (b).We find that, when the quantity of UAVs was less than 300, the three methods exhibited little difference; however, as the quantity of UAVs increased, the computation times of the two grid methods were significantly better than that of the method based on three-dimensional coordinates.Moreover, the method based on 64 m grids was superior to that based on basic 64 m grids.The general trends were similar to those observed in the obstacle-free experiment, and the time consumed for collision detection was reduced by approximately 70-80% with the proposed method.
however, as the quantity of UAVs increased, the computation times of the two grid methods were significantly better than that of the method based on three-dimensional coordinates.Moreover, the method based on 64 m grids was superior to that based on basic 64 m grids.The general trends were similar to those observed in the obstacle-free experiment, and the time consumed for collision detection was reduced by approximately 70%-80% with the proposed method.

Detection with Formation Optimization
Next, we optimized the calculations for the UAV formation with fixed relative positions.When the UAVs perform cooperative tasks by flying as a group, they can be regarded as flying in a formation.A UAV formation can be rigidly defined by relative position vectors.Because the speed of each aircraft is limited, it is impossible to achieve a large displacement in a short time.If the satellite positioning refresh frequency can be maintained, we need only to detect the collision for each previously occupied grid in a restricted space, thereby reducing the overall computation time.In this experiment, the search was limited to 2 levels.Different from the previous simulation experiments,

Detection with Formation Optimization
Next, we optimized the calculations for the UAV formation with fixed relative positions.When the UAVs perform cooperative tasks by flying as a group, they can be regarded as flying in a formation.A UAV formation can be rigidly defined by relative position vectors.Because the speed of each aircraft is limited, it is impossible to achieve a large displacement in a short time.If the satellite positioning refresh frequency can be maintained, we need only to detect the collision for each previously occupied grid in a restricted space, thereby reducing the overall computation time.In this experiment, the search was limited to 2 levels.Different from the previous simulation experiments, the UAVs in this simulation experiment were constrained by a formation.Figure 9

Discussion
It is feasible to employ the collision detection method based on GeoSOT-3D grids proposed in this study for better UAV management and monitoring, as the novel technique also benefits flight path planning, airspace control, and formation flight.The reduction in the time consumption compared with the traditional methods is approximately 50%-80%.Furthermore, as the amount of data in the airspace increases, the approach proposed in this study becomes more advantageous.These improvements may arise for the following reasons: 1) Traditional methods require one-to-one calculations between different entities to determine

Discussion
It is feasible to employ the collision detection method based on GeoSOT-3D grids proposed in this study for better UAV management and monitoring, as the novel technique also benefits flight path planning, airspace control, and formation flight.The reduction in the time consumption compared with the traditional methods is approximately 50-80%.Furthermore, as the amount of data in the airspace increases, the approach proposed in this study becomes more advantageous.These improvements may arise for the following reasons: 1) Traditional methods require one-to-one calculations between different entities to determine their spatial relationship, but the proposed method with grid coding needs only to query within the database, and thus, the computation times are reduced.
2) Hierarchical coding schemes enable efficient filtering to remove a large number of redundant or unnecessary calculations.
3) Using nonrelational database storage along with a multitable strategy improves the multilevel operation efficiency and allows parallel computing.
As the size of the grid increases, the computations required for detection within each grid also increase.The position, flying direction, and speed of UAVs at each time can be acquired, and the flying direction and speed vary randomly within a small range.In addition, the UAVs can be categorized according to size and maximum speed; therefore, the optimal grid sizes are different.In general, to ensure a safe distance during flight and high computational efficiency, if the flying speed is low, a smaller grid size would be preferred; if the UAV is small, a smaller grid size would also be preferred.The simulations in this study are provided to demonstrate the grid size selection for one type of UAV.The calculation and comparison process can be applied to UAVs of other sizes and flying speeds.In this research, we did not carry out real tests, only simulation experiments.In future research, we intend to perform experiments on real UAVs to further verify the utility of the GeoSOT-3D grid-based model.

Conclusions
Collision detection in a highly dynamic and complex environment is key for a variety of UAV applications.Two traditional categories of approaches for collision detection were criticized for their computational complexity.The first category of methods utilizes different sensing technologies as the basis of collision detection, whereas the second category uses global or relative positioning systems to acquire the coordinates of UAVs and obstacles within an airspace.Two disadvantages of previous studies on UAV collision detection were discussed.First, pairwise calculations must be performed based on the spatial coordinates acquired by either airborne or satellite sensors; consequently, the computational burden increases exponentially with an increase in the number of spatial entities.Second, although multidimensional grids provide an alternative for UAV collision detection, the existing grid-based approaches are not suitable for complicated scenarios with large numbers of high-speed moving objects.
This study demonstrated an approach for detecting collisions among UAVs based on GeoSOT-3D grids.The proposed method is based on the GeoSOT-3D spatial subdivision theory, which has proven its applicability in various applications.All UAVs and other entities in a studied airspace should first be transformed into one or more GeoSOT-3D grids.The code for each grid should then be set as the primary key for the nonrelational database.The multitable strategy was adopted in the proposed method by considering the hierarchical advantages of GeoSOT-3D coding, and the collision detection calculation was transformed into a multilevel query.We described two algorithms for a single grid and multiple grids in detail.In the detection process, new data, such as UAV trajectory data and obstacle data, should be inserted after being transformed into GeoSOT-3D codes.In this way, the computational efficiency is significantly improved.After detecting collisions, the new codes are inserted as new columns instead of new rows.The proposed method involves not only potential collisions with traffic but also other categories of entities in the studied airspace.
To verify the suitability and efficiency of the proposed method, we designed and conducted four UAV formation flight simulation experiments.Accordingly, the feasibility of detecting the collisions of UAVs based on GeoSOT-3D grids in three-dimensional space was proven.We compared different grid sizes for collision detection, with the number of UAVs ranging from 100 to 1000, and the computation time of the 64 m GeoSOT-3D grids was the lowest.For different numbers of UAVs, the time required to achieve collision detection with different calculation methods was acquired.The efficiency of the grid

Figure 1 .
Figure 1.Detailed illustration of GeoSOT-3D grids on Level 2. The codes for the three-dimensional grids are marked on the surface of the cube and on four separate layers.The binary codes are also listed for the front side, right side, and each layer.

Figure 1 .
Figure 1.Detailed illustration of GeoSOT-3D grids on Level 2. The codes for the three-dimensional grids are marked on the surface of the cube and on four separate layers.The binary codes are also listed for the front side, right side, and each layer.

Figure 2 .
Figure 2. Traditional calculation method and spatial database-based query method for unmanned aerial vehicle (UAV) collision detection.Traditional collision detection methods depend on pairwise calculations based on three-dimensional coordinates (a).The calculation complexity increases rapidly as the number of UAVs increases.The grid-based method simplifies the collision detection procedure as a comparison process for regular-sized spatial grids (b).The grid-based method can be further advanced with a UAV management table (c).In the table, the GeoSOT-3D code is set as the primary key, and the collision can be detected by a straightforward query.

Figure 2 .
Figure 2. Traditional calculation method and spatial database-based query method for unmanned aerial vehicle (UAV) collision detection.Traditional collision detection methods depend on pairwise calculations based on three-dimensional coordinates (a).The calculation complexity increases rapidly as the number of UAVs increases.The grid-based method simplifies the collision detection procedure as a comparison process for regular-sized spatial grids (b).The grid-based method can be further advanced with a UAV management table (c).In the table, the GeoSOT-3D code is set as the primary key, and the collision can be detected by a straightforward query.

Figure 3 .
Figure 3. Multitable strategy.There are a number of data tables in the nonrelational database.Each data table records spatiotemporal data at a specific subdivision level.Records at higher levels preserve pointers to the data table at lower levels.The GeoSOT-3D grid code is set as the primary key for each table.Temporal information is also recorded corresponding to each GeoSOT-3D code.

Figure 3 .
Figure 3. Multitable strategy.There are a number of data tables in the nonrelational database.Each data table records spatiotemporal data at a specific subdivision level.Records at higher levels preserve pointers to the data table at lower levels.The GeoSOT-3D grid code is set as the primary key for each table.Temporal information is also recorded corresponding to each GeoSOT-3D code.

15 SpaceFigure 4 .
Figure 4. Collision detection for a single grid.A single spatiotemporal grid with CodeA and a time interval from TA to TA' is compared with the existing data at multiple levels.After determining the spatial relationship, the spatiotemporal grid information can be inserted into multiple data tables in parallel.

Figure 4 .
Figure 4. Collision detection for a single grid.A single spatiotemporal grid with Code A and a time interval from T A to T A ' is compared with the existing data at multiple levels.After determining the spatial relationship, the spatiotemporal grid information can be inserted into multiple data tables in parallel.

Figure 5 .
Figure 5. Collision detection for multiple grids.Multiple spatiotemporal grids are compared individually with the existing data at multiple levels.After determining the spatial relationship, the spatiotemporal grid information can be inserted into multiple data tables in parallel.

Figure 5 .
Figure 5. Collision detection for multiple grids.Multiple spatiotemporal grids are compared individually with the existing data at multiple levels.After determining the spatial relationship, the spatiotemporal grid information can be inserted into multiple data tables in parallel.

Figure 7 .
Figure 7. Time required for detecting collisions with three methods.The three methods consist of calculations with three-dimensional coordinates, calculations with simply 64 m grids, and spatial database queries with 64 m GeoSOT-3D grids.

Figure 7 .
Figure 7. Time required for detecting collisions with three methods.The three methods consist of calculations with three-dimensional coordinates, calculations with simply 64 m grids, and spatial database queries with 64 m GeoSOT-3D grids.

Figure 8 .
Figure 8.Time required to detect collisions with three methods in an airspace containing obstacles.In simulation experiment (a), a 1 km × 1 km × 1 km obstacle was placed at the center of the airspace.In simulation experiment (b), 100 obstacles of the same size as the UAVs were placed within the airspace.

Figure 8 .
Figure 8.Time required to detect collisions with three methods in an airspace containing obstacles.In simulation experiment (a), a 1 km × 1 km × 1 km obstacle was placed at the center of the airspace.In simulation experiment (b), 100 obstacles of the same size as the UAVs were placed within the airspace.
indicates that formation optimization can reduce the time consumption by up to 25%.ISPRS Int.J. Geo-Inf.2019, 8, x FOR PEER REVIEW 12 of 15the UAVs in this simulation experiment were constrained by a formation.Figure9indicates that formation optimization can reduce the time consumption by up to 25%.

Figure 9 .
Figure 9.Time required to detect a collision after formation optimization.Collision detection with optimization is shown with a green line.The optimization is based on the premise that the UAVs are established in a fixed formation.

Figure 9 .
Figure 9.Time required to detect a collision after formation optimization.Collision detection with optimization is shown with a green line.The optimization is based on the premise that the UAVs are established in a fixed formation.