Note
Go to the end to download the full example code
Parsing image metadata#
This example demonstrates the instantiation of an image through SatelliteImage
.
import geoutils as gu
We print the filename of our raster that, as often with satellite data, holds metadata information.
filename_geoimg = gu.examples.get_path("everest_landsat_b4")
import os
print(os.path.basename(filename_geoimg))
LE71400412000304SGS00_B4.tif
We open it as a geo-image, un-silencing the attribute retrieval to see the parsed data.
img = gu.SatelliteImage(filename_geoimg, silent=False)
From filename: setting satellite as Landsat 7
From filename: setting sensor as ETM+
From filename: setting tile_name as 140041
From filename: setting datetime as 2000-10-30 00:00:00
We have now retrieved the metadata. For the rest, the SatelliteImage
is a subclass of Raster
, and behaves similarly.
Total running time of the script: (0 minutes 0.020 seconds)