7

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.

  • What do you mean by 'visualize'? Do you want to see the image in the context of a coordinate system, or just view the image itself? – nagytech Jul 17 '12 at 0:00
  • Just the image itself. Althought a coordinate system would be nice, I'm not sure about what you mean with this but you made me think RGB coordinates. – JEquihua Jul 17 '12 at 2:22
3

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/

  • I want to visualize REALLY simple images, made by myself, like a 500 x 500 constant matrix with salt and pepper noise. Should be pretty straight forward right? It must be a geotiff file though. ... Dammit, now I'm not sure, anyway, I'll look into what you propose, thanks a lot! – JEquihua Jul 17 '12 at 2:30
6

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.

orfeo

i hope it helps you...

  • +1 This is excellent! Have you ever used Orfeo for tree cover classification? – Aaron Jul 17 '12 at 12:41
  • this is an opensource project... i have only checked out his capability for image processing. i have usually been using envi for now to my licence expire for enterprise works and it is really very good when u work with multi-spectral images. – Aragon Jul 17 '12 at 14:06
4

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)

3

PIL (with a limited set of tiff file types) or ImageMagick would to the trick.

3

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

1

Rasterio and matplotlib has all the functionality you need to display and manipulate multiband raster data. The Rasterio documentation has a very helpful IPython notebook that goes through various examples of displaying and analyzing multiband raster data.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.