def compressGeotiff(pythonpath,sourcepath,outputpath):
if os.path.exists(outputpath):
os.remove(outputpath)
subprocess.call([pythonpath,"-co","COMPRESS=DEFLATE",sourcepath,outputpath])
不同压缩算法比较:http://linfiniti.com/2011/05/gdal-efficiency-of-various-compression-algorithms/
GDAL: efficiency of various compression algorithms
Posted May 31, 2011 by Rudi Thiede & filed under QGIS.
Let’s say you’ve got a lot of raster files you want to host on your map server, or even just one large backdrop. I needed to do the latter, but either way, you’re faced with the same problem: how can I reduce file size and access time? Whatever else I do – such as building pyramids – my raster file is going to be compressed some way or another. I can’t very well have visitors waiting for my server to run through an elaborate (de)compression method, but neither can I store images of the