예제 #1
0
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
예제 #2
0
 def __init__(self):
     self.country_checker = CountryChecker(settings.RESOURCE_PATH + "/" + settings.GDAL_SHAPE_FILENAME)