1

I'm starting to play with satellite imagery. In particular, I am using images of the Landsat 7 and Python. I open two TIF images of the same place but at different times to the numpy arrays and they have different shapes.

import numpy as np
import rasterio

with rasterio.open(image1_path) as src:
    B1_t1 = src.read().astype(read_astype)[0]
with rasterio.open(image2_path) as src:
    B1_t2 = src.read().astype(read_astype)[0]

B1_t1.shape
B1_t2.shape

#OutPut
#>>>(7811, 6951)
#>>>(7791, 6941)

These two images are from the same path/row.

  • Have you actually tried viewing these images in a GIS? Are they shifted in some way, got NODATA columns. That's the first place I would start to try and identify why they are different. For example if they are identical when viewed in a GIS it would suggest the mechanism you are using now is corrupted in some way? – Hornbydd Aug 20 '15 at 17:07
  • 1
    Yes, they do. You can count on rasterio (and GDAL, under the hood) to read TIFFs properly. – sgillies Aug 21 '15 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.