'Given a gis_location record or a bounding box dict with keys
lon_min, lon_max, lat_min, lat_max, construct a WKT polygon with
points at the corners.'

@staticmethod
def get_polygon_from_bounds(bbox):

    lon_min = bbox['lon_min']
    lon_max = bbox['lon_max']
    lat_min = bbox['lat_min']
    lat_max = bbox['lat_max']
    points = [(lon_min, lat_min), (lon_min, lat_max), (lon_max, lat_max), (lon_min, lat_max), (lon_min, lat_min)]
    pairs = [('%s    %s' % (p[0], p[1])) for p in points]
    wkt = ('POLYGON    ((%s))' % ',    '.join(pairs))
    return wkt
