Convert geo_polygon to geo_radius


I made a quick little Python script to convert geo_polygon filters to geo_radius:

See inline comments for additional info.

Calculations use polygon boundary barycenter and great circle distance. I’m no GIS guy, but this ought to suffice for most people, especially given the general low quality of twitter geo_tags.

If you’re running short on DPUs this can go a long way, at the cost of some precision.