def load_geo_size(path, left_top, size): global geo_size_loaded if path in geo_size_loaded: print 'no double loading %s'%path return try: print 'loading geo %s'%path for p in csv.DictReader(open(path, 'rt')): x=int(p['x']) y=int(p['y']) img = int(p['img']) s = int(p['s']) #skip holes if img >= 90: continue #skip stars #if s == 11: # continue #if in_rect( (x,y), left_top, size): db.set_planet_geo_size(p) geo_size_loaded.add(path) except IOError, e: log.error('failed to load csv %s: %s'%(path, e))
def load_geo_size_all(path): try: print 'load all geo sizes from %s'%path for p in csv.DictReader(open(path, 'rt')): db.set_planet_geo_size(p) except IOError, e: log.error('failed to load csv %s: %s'%(path, e))