def __init__(self, country_file): driver = ogr.GetDriverByName('ESRI Shapefile') self.countryFile = driver.Open(country_file) self.layer = self.countryFile.GetLayer()