# Airspace Geofencing and Flight Planning for Low-Altitude, Urban, Small Unmanned Aircraft Systems
## 4 Environment Modeling  
_Map Data Processing_  
To evaluate the proposed geofencing capability in a complex low-altitude environment, we processed OpenStreetMap (OSM) data for the Manhattan Borough of New York City (USA). OSM is a collaborative global mapping project that creates geographical data and information [41]. OSM is frequently updated and provides map entities including airways, roads, buildings, and more. To minimize map processing overhead for this work, we used pre-processed georeferenced OSM Manhattan building data as described in Ref. [42]. This raw data contain building coordinates represented as polygon vertices, building heights, and street level in WGS 84/UTM zone 18N [43], where units are in meters with East, North, Up (ENU) axes. We applied a combination of set and convex hull [32] operations to simplify geofence geometry for flight planning. Figure 7 shows the flowchart for map data post-processing. After post-processing, the dataset was partitioned into four categories: buildings with heights greater than 20 m, 60 m, 122 m, and 400 m. Depending on sUAS start and end altitude (i.e., roof of building, ground), flight planning utilizes one of these four datasets to generate plans and associated geofence volumes.  
Figure 8 shows a map of southern Manhattan with closely spaced building clusters each enclosed by a single keep-out geofence to simplify the Manhattan urban canyon map. Figure 9 shows an example of post-processed georeferenced data and its 3-D keep-out geofence.  
Figure 8: Post-processing map data for southern Manhattan. Buildings with heights greater than 20 m are shown. The rightmost plot shows keep-out geofences enclosing building clusters (black solid lines), individual building keep-out geofences (black dashed lines), and building outlines (colored lines). Geofence maps for 60 m, 122 m, and 400 m altitude cross-sections are constructed in the same manner.  
Figure 7: Flowchart of post-processing map data. OSM data were converted to a MATLAB format, then processed using polygon set convex hull operators to reduce the number of keep-out geofences in the region of interest (ROI), the area between departure and destination points. If the number of vertices in a geofence is greater than threshold \(n_{maxVent}\), it is downsampled to \(P_{durbSample}\). \(n_{maxVent}\) and \(p_{durbSample}\) are user-defined parameters set to 15 and 60%, respectively, in this work. Algorithms 2 and 3 are used in finding ROI and reducing number of map vertices. Three-dimensional keep-out geofences around buildings are generated with safety buffer \(\delta_{building}\).  
Figure 9: Post-processed georeferenced data for the One World Trade Center building in Manhattan. The top left and right show raw OSM data side and top views, respectively. The bottom left and right show post-processed keep-out geofence data (shaded in green) side and top views, respectively.  
A southern Manhattan, New York City map was defined by 14,000 building cluster geofence polygons using the above procedure. To further simplify the map, we downsampled geofence vertices and construct an updated set of keep-out geofences from the ROI visibility graph per Algorithms 2 and 3 in Section 3.2. Figure 10 shows an example of the rectangular ROI, ROI obstacle polygon, and visibility graph generation pipeline. The \"turn\" flight planning visibility graph was constructed from keep-out geofences inside the ROI along with departure and destination locations.