easyidp.geotiff.save_geotiff#
- easyidp.geotiff.save_geotiff(header, imarray, left_top_corner, save_path)#
保存切块的区域为Geotiff文件
- 参数:
header (dict) – the geotiff head dictionary from get_header()
imarray (ndarray) – (m, n, d) image ndarray cropped from crop_polygon
left_top_corner (ndarray) –
the pixel position of image top left cornder,the order is (left, top)save_path (str) – Geotiff文件的保存路径
示例
Prepare data:
>>> import easyidp as idp >>> test_data = idp.data.TestData() >>> dom = idp.GeoTiff(test_data.tiff.soyweed_part) >>> dom_imarray = idp.geotiff.get_imarray(test_data.tiff.soyweed_part)
If want to move each 20 pixels of this geotiff to right and bottom
>>> left_top_corner = [200, 200] # add 20 and 20 offsets >>> save_tiff = "path/to/save/output.tif" >>> idp.geotiff.save_geotiff(dom_test.header, dom_imarray, left_top_corner, save_tiff)
Then using the QGIS to compare between input and output: