def extractAll(self): shp = ShpParser(config.poly_dir) for city in config.allcities.keys(): # Greater London is a special case as it has 32 councils if city != "Greater London": shp.parse(config.boundaries_file, city, False) shp = ShpParser(config.greater_london_out_dir) for borough in config.greater_london: shp.parse(config.boundaries_file, borough, False) pts = convexhull.merge(config.greater_london_out_dir) c = convexhull.convexHull(pts) shp.write('Greater London_OSGB36_polygon.csv', c)
def extractConvexhulls(self): shp = ShpParser(config.convexhulls_dir) allfiles = [f for f in os.listdir(config.poly_dir) if os.path.isfile(os.path.join(config.poly_dir,f)) and "OSGB36_polygon.csv" in f] for fn in allfiles: pts = convexhull.loadCSV(config.poly_dir+fn) pts = shp.convert_list_to_WGS84(pts) c = convexhull.convexHull(pts) shp.write(fn[0:-18]+"WGS84_convexhull.csv", c) name = "Greater London_OSGB36_polygon.csv" pts = convexhull.loadCSV(config.greater_london_out_dir+name) pts = shp.convert_list_to_WGS84(pts) shp.write(name[0:-18]+"WGS84_convexhull.csv", pts)