class Coordinate_handler(): def __init__(self): self.country_checker = CountryChecker(settings.RESOURCE_PATH + "/" + settings.GDAL_SHAPE_FILENAME) def find_country_code_for_coordinates(self, coord): # twitter coord are switched try: cc_code = self.country_checker.getCountry(Point(coord[1], coord[0])).iso except Exception, e: #print coord, str(e) cc_code = "error" return cc_code
def __init__(self): self.country_checker = CountryChecker(settings.RESOURCE_PATH + "/" + settings.GDAL_SHAPE_FILENAME)