load_geo_img_dir#
Module : eotorchloader.dataset.utils
- load_geo_img_dir(img_dir: pathlib.Path, img_suffix_list=['.tif', '.jp2']) pandas.DataFrame #
list info/metadata of images from a directory into a dataframe
list all images which are in a img_dir and with suffix present in img_suffix_list. All image are open with rasterio to load their geographic metadata and all the informations are written in a pandas Dataframe with one row by image and with columns :
“name” : name (str) of the image without extension
“path” : full path of the image (dir+name+extension)
“width” : width of the image in pixel (int)
“height” : height of the image in pixel (int)
“res_x” : resolution in x axis (float)
“res_y” : resolution in y axis (float)
“ul_x” : upper left coordinate of the image in x axis (float)
“ul_y” : upper left coordinate of the image in y axis (float)
“transform” : full affine transform to convert from pixel coordinate to grund coordinate. follow the rasterio convention.
Note
The rasterio transform convention is :
transform = ( resolution/scale x, rotation row/x, upper_left/origin x, rotation col/y, resolution/scale y, upper_left/origin y)
- Parameters
img_dir (Path) – Path of the directory where images will be search
img_suffix_list (List[str]) – list of image extension to filter files in img_dir.
- Returns
Pandas dataframe with a row by images. empty if no images found
- Return type
pd.DataFrame