You simply make it so operators cannot fly into these areas. This is exactly what DJI did with their No Fly Zones.
DJI's Phantom 4 Drone
DJI is the world's most popular drone manufacturer. Founded in 2006, DJI’s drones are used for many applications from professional level photography to hobbyists. DJI makes many different drones that are relatively easy to fly and relatively accessible. With their rise in popularity, drones have gotten some negative publicity. To combat this, DJI created a no-fly zone system.
Right now in the United States, it's illegal to fly an unauthorized recreational drone above four hundred feet and for them to be within five miles of any airport without permission. Drones are also required to avoid obstacles, avoid buildings and stadiums, and large crowds of people. The drone’s operator must control the drone in a safe manner. All of these rules are to protect other aircraft, people, and property from being damaged by the high-speed props and potential crashes. These laws are for recreational drones and not commercial drones; drones used for commercial applications are governed by even more rules and regulations! You can find regulations for commercial and hobbyist drones on the FAA's website.
The Drone that Crashed at the White House. Image from the New York Times Article
DJI drones use GPS to first warn the user that they are about to fly into a No-Fly Zone. No-fly zones are within five miles of airports or other sensitive areas. If the user continues to fly into the No-Fly Zones, the drone will begin to descend to a lower height the closer the drone gets to the center of the No-Fly Zone. DJI makes the center of the restricted area a one-and-a-half-mile zone around large airports (smaller restricted areas around other airports). In this one-and-a-half-mile zone, DJI will not allow their drones to take off or enter. If DJI’s GPS system is not functioning, and the drone enters a No-Fly Zone then reestablishes GPS capabilities, the drone will automatically land while only giving the pilot control over horizontal movement. DJI also prevents waypoints from being created in its application that would fall into these 5-mile limited flight zones. Although, if the drones do not have the GPS enabled they are still able to fly everywhere. DJI uses data from a system called AirMap, shown below. Airmap contains a nationwide list of no-fly zones.
A map of around New York and Eastern PA of No Fly Zones from AIRMAP
The way that DJI's No-Fly Zone is marketed would be lead people to believe that they are not violating the law because the drone would stop them from actually violating the law, however, this is not the case. The most likely reason that DJI would not make the restricted zone the full five miles (as called for by the law) is because the law is unduly burdensome. By limiting the height in the area surrounding a restricted zone, DJI decreases the likelihood of mid-air collisions while not limiting the ability to fly too much. Any mid-air crash with a DJI zone would look bad for the company. By all accounts limiting the area in which the drones can fly, DJI hasn’t lost much market share if any at all.
Adam Savage, of Mythbusters, with his DJI drone. From Tested
DJI limits where the operator is able to fly. However, the pilot still has the opportunity to violate the law in the United States even with the GPS restrictions imposed by DJI. Ultimately, the operator is responsible for where their drone goes, but DJI is assisting the user in knowing the laws.