Adaptive geohash location search SQL generator in Python