Another approach using rasterio
import rasterio
import numpy as np
dataset = rasterio.open('P3412A.tif')
band1 = dataset.read(1)
rows, cols = np.where(band1 == np.max(band1))
lon, lat = rasterio.transform.xy(dataset.transform, row[0], col[0])
print(lat, lon)
---
Ujaval Gandhi
Spatia
-raster-using-python&userId=8747767&signature=ad33731e269a50d0]
---
Ujaval Gandhi
Spatial Thoughts
www.spatialthoughts.com
[https://mailtrack.io/trace/link/8a3e8e7a8c5d14be3dd980b240946403e1f8024c?url=http%3A%2F%2Fwww.spatialthoughts.com&userId=8747767&signature=9b2a49a0cd6960e4]
As Lautentiu mentioned, you need to install GDAL in the Colab environment. Here's an example notebook showing how https://colab.research.google.com/drive/1vOdd-kGAvR0Nhcrc6OpOLDeH3KZgzP8c?usp=sharing---Ujaval GandhiSpatial Thoughtswww.spatialthoughts.comOn Thu, May 11, 2023 at 12:26 PM Laurențiu Ni
d=8747767&signature=f3a663794cf05dc3]
---
Ujaval Gandhi
Spatial Thoughts
www.spatialthoughts.com
[https://mailtrack.io/trace/link/4ddad0f9cf2b5c3c4c75c835dbf4a885ea30591b?url=http%3A%2F%2Fwww.spatialthoughts.com&userId=8747767&signature=de7d85fbbe1e0bcd]
[data:image/gif;base
What about using JPEG compression with GeoTIFF files instead and thus enabling
you to use COGs? In my experience, you can get pretty close to the JPEG2000 file
size with a GeoTIFF with JPEG compression.
---
Ujaval Gandhi
Spatial Thoughts
www.spatialthoughts.com
[https://mailtrack.io/trace/link
efficient. See the
workflow at https://courses.spatialthoughts.com/gdal-tools.html#merging-tiles
[https://courses.spatialthoughts.com/gdal-tools.html#merging-tiles]
---
Ujaval Gandhi
Spatial Thoughts
www.spatialthoughts.com [http://www.spatialthoughts.com]
[data:image/gif;base64,R0lGODlhAQABAIAAAP