How to Process .KEA files in Python

150 views
Skip to first unread message

Maitrik Shah

unread,
May 14, 2021, 6:44:47 AM5/14/21
to rsgislib...@googlegroups.com
I have used ARCSI for getting TOA and BOA images. The output file format is .KEA.

-How can I read .KEA images in python? I want to apply a deep learning model on these images.
-Can I separate different band images from .KEA format? 

--
Thanks and Regards,
Prof. Maitrik K Shah,
Assistant Professor,
Computer Engineering Department,
L.D. College of Engineering,
(M) 9537906229

Peter Bunting

unread,
May 14, 2021, 8:07:49 AM5/14/21
to Maitrik Shah, RSGISLib
Using the python environment you have for ARCSI then you can just read a KEA file as you can any other GDAL dataset. See the GDAL tutorials: https://gdal.org/tutorials/index.html

You can also use gdal_translate to convert to other formats (e.g., GeoTIFF). 

Best wishes, 

Pete

--
You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rsgislib-support/CAO6NxUY8AGfFBpGoG_9WOSwUdmz59wV%2Br4KBgATeh0rWF3mrPQ%40mail.gmail.com.

Maitrik Shah

unread,
May 15, 2021, 12:22:14 PM5/15/21
to RSGISLib Support
Thank you Very much...

I used Landsat8 Image with ARCSI.  Using arcsi.py -s ls8 -f KEA --stats -p RAD TOA, I obtained .kea file.
I converted .kea into .tif file using gdal_translate command.

Now I read that file using    
dataset = gdal.Open(filename) and then 
dataset.RasterCount returns 7.

It means dataset has 7 raster bands. 

Now my original image was Landsat8 Image which contains 9 bands (ignoring two thermal bands). 

My question is which 7 bands are there in .tif file? 

Peter Bunting

unread,
May 15, 2021, 12:25:16 PM5/15/21
to Maitrik Shah, RSGISLib
Dear Maitrik, 

The bands are named in the file:

Coastal
Blue
Green
Red
NIR
SWIR1
SWIR2

Best wishes, 

Pete

Reply all
Reply to author
Forward
0 new messages