This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DataSift CSDL polygon to radius filter converter by Sergey Vershinin (https://gist.github.com/svershin) | |
# Takes a CSDL file that has some geo_polygon filters and converts them | |
# to centroids with an appropriate radius, commenting out the old geo_polygon statements | |
# *** NOTE: The script expects to have the 'twitter.geo geo_polygon "..."' statement on its own line | |
# *** BUG ALERT: Have not tested with scripts that have 'GEO_POLYGON' in upper case | |
import math | |
import string |