add tip list
This commit is contained in:
parent
7b9d7734ab
commit
c733cf64e1
12 changed files with 598 additions and 187 deletions
25
check_tif.py
Normal file
25
check_tif.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import rasterio
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
import sys
|
||||
|
||||
# --- Konfiguration ---
|
||||
tif_path = 'geodata/s2_2025.tif'
|
||||
|
||||
try:
|
||||
with rasterio.open(tif_path) as src:
|
||||
print(f"Datei: {tif_path}")
|
||||
print(f"CRS: {src.crs}")
|
||||
print(f"Breite x Höhe: {src.width} x {src.height}")
|
||||
print(f"Bänder: {src.count}")
|
||||
print(f"Datentyp: {src.dtypes}")
|
||||
arr = src.read(1)
|
||||
print(f"Min: {np.nanmin(arr)}, Max: {np.nanmax(arr)}")
|
||||
plt.imshow(arr, cmap='gray')
|
||||
plt.title('Erstes Band der TIFF-Datei')
|
||||
plt.axis('off')
|
||||
plt.savefig('datenvisualisierung/tif_check.png', bbox_inches='tight', dpi=200)
|
||||
plt.show()
|
||||
except Exception as e:
|
||||
print(f"Fehler beim Laden der TIFF-Datei: {e}")
|
||||
sys.exit(1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue