Earlier this year I wrote a proposal on how we might integrate no-fly zones into ArduPilot and PX4. Read it here
A dronecode working group was created, but that group fizzled out pretty quickly. I was reminded of this when I saw an old issue yesterday, and so I want to bring this up again. I'm willing to put in some work, but there are a few things that need to be agreed upon first. The biggest issue that was pointed out with the proposal above is that a pixhawk would struggle with parsing JSON, and a binary protocol would be better suited. So here it is: a packer (in python) and an unpacker (in C). https://github.com/squilter/nofly-tiles
The demo packs 4 circles and one polygon into only 79 bytes. Here is a writeup of that format, although it's kinda confusing.
The receiving side should definitely be a dronecode library which can be submoduled by ardupilot and PX4. Dronecode should host the tiles online.
Once the data is in the autopilot, it can easily be used as a pre-arm check. But it can also be much more. ArduCopter's AC_Avoidance could allow somebody to take off near a sports stadium, but an invisible fence would prevent them from actually flying over it.
What do people think of this tile format? The main problem is that it is not extensible, so if somebody said "Let's make a no-fly zone that exists between 6pm and 8pm on weekdays", it might be very difficult to implement without breaking everything. But I think the ultimate goal is still to switch to GeoJSON once the board can handle that, so we already have a plan to fix the extensibility problem.