摘要: driver = ogr.GetDriverByName('ESRI Shapefile')datasource = driver.Open(shpFileName, 1)layer = datasource.GetLayer()for feature in layer: dataValue = n 阅读全文
posted @ 2017-11-16 11:25 忆如梨花 阅读(1343) 评论(0) 推荐(0) 编辑
摘要: cols = array.shape[1]rows = array.shape[0]originX = rasterOrigin[0]originY = rasterOrigin[1]driver = gdal.GetDriverByName('GTiff')outRaster = driver.C 阅读全文
posted @ 2017-11-16 11:23 忆如梨花 阅读(807) 评论(0) 推荐(0) 编辑
摘要: array = np.asarray(allBigPng, dtype=np.uint8)image = Image.fromarray(array, 'RGBA') image.save(outputImgPath + pollutionName + '.png')注意:dtype一定要写,否则图 阅读全文
posted @ 2017-11-16 11:21 忆如梨花 阅读(12114) 评论(0) 推荐(0) 编辑
摘要: data = gdal.Open(templateTifFileName, gdalconst.GA_ReadOnly)geo_transform = data.GetGeoTransform()x_min = geo_transform[0]y_min = geo_transform[3]x_re 阅读全文
posted @ 2017-11-16 11:17 忆如梨花 阅读(5472) 评论(0) 推荐(1) 编辑