Is there any way (a package or what not), to visualize a GeoTIFF image directly in Python?
I don't want to use ENVI or ArcGIS or anything else.
Is there any way (a package or what not), to visualize a GeoTIFF image directly in Python?
I don't want to use ENVI or ArcGIS or anything else.
if you are interested with RS - Remote Sensing, you can check out Orfeo Toolbox here. following information from their site:
a set of algorithmic components, adapted to large remote sensing images, which allow to capitalize the methodological know how, and therefore use an incremental approach to benefit from the results of the methodological research.
i hope it helps you...
you can use also Matplotlib with the cartographic module (Basemap) without problem, see, for example, Retrieving last images from MODIS Satellites and ploting earthquakes or Python: visualiser en temps quasi réel les images satellites et les shapefiles MODIS ou les données sismiques de l'USGS (in french)
You can use PIL and Tkinter or other GUI framework to create a simple image viewer. If PIL is unable to read the image you could use GDAL to convert it to a suitable format before displaying it.
Here's a Tkinter example: http://codeidol.com/python/python3/A-Tkinter-Tour,-Part-1/Viewing-and-Processing-Images-with-PIL/
Nothing beats GDAL
from osgeo import gdal
import matplotlib.pyplot as plt
ds = gdal.Open('file.tif').ReadAsArray()
im = plt.imshow(ds)
plt.colorbar(im)
And to do some proper mapping with projections included use cartopy
Rasterio and matplotlib has all the functionality you need to display and manipulate multiband raster data. For example, here is how you can plot a RBG image using Rasterio:
import rasterio
from rasterio.plot import show
indata = '/path/to/your/imagery.tif'
# Note that example uses 4 band NAIP imagery
with rasterio.open(indata) as src:
arr = src.read([1,2,3], masked=True)
show(arr)