easyidp.geotiff.get_header

easyidp.geotiff.get_header(tif_path: str | Path) dict

从 GeoTIFF 文件中读取必要的元信息

参数:

tif_path (str) -- GeoTIFF 文件的路径

返回:

  • header (dict) -- the container of acquired meta info

  • .. caution:: -- Since v2.0.2, this function backend has been switched from tifffile to rasterio to improve the performance, Some of the key tags in header like 'tags', 'photometric', 'planarconfig', 'compress' has been deprecated.

示例

>>> import easyidp as idp
>>> test_data = idp.data.TestData()

>>> lotus_full = idp.geotiff.get_header(test_data.pix4d.lotus_dom)
>>> lotus_full
{'height': 5752, 'width': 5490, 'dim': 4, 'nodata': 0, 'dtype': dtype('uint8'),
    'scale': [0.00738, 0.00738], 'tie_point': [368014.54157, 3955518.2747700005],
    'crs': <Derived Projected CRS: EPSG:32654>
        Name: WGS 84 / UTM zone 54N
        Axis Info [cartesian]:
        - E[east]: Easting (metre)
        - N[north]: Northing (metre)
        Area of Use:
        - name: Between 138°E and 144°E, northern hemisphere between equator and 84°N,
                onshore and offshore. Japan. Russian Federation.
        - bounds: (138.0, 0.0, 144.0, 84.0)
        Coordinate Operation:
        - name: UTM zone 54N
        - method: Transverse Mercator
        Datum: World Geodetic System 1984 ensemble
        - Ellipsoid: WGS 84
        - Prime Meridian: Greenwich
}