⚠️ Our 0.1 release refactored several early-development functions for long-term stability, to update your code see here. ⚠️
Future changes will come with deprecation warnings! 🙂

Parsing image metadata

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.

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.

SatelliteImage(
  data=[[255 255 255 ... 255 255 255]
        [255 255 255 ... 255 255 255]
        [255 255 255 ... 255 255 255]
        ...
        [ 74  76  79 ... 121 119 141]
        [ 75  83  70 ... 112 130 150]
        [ 64  86  68 ... 124 131 130]]
  transform=| 30.00, 0.00, 478000.00|
            | 0.00,-30.00, 3108140.00|
            | 0.00, 0.00, 1.00|
  crs=EPSG:32645
  nodata=None)


Total running time of the script: (0 minutes 0.020 seconds)

Gallery generated by Sphinx-Gallery