Skip to content

Instantly share code, notes, and snippets.

@pdbartsch
Last active September 28, 2023 06:07
Show Gist options
  • Save pdbartsch/5fb09d191f2fd7c1fef7 to your computer and use it in GitHub Desktop.
Save pdbartsch/5fb09d191f2fd7c1fef7 to your computer and use it in GitHub Desktop.
Locate, download and process Landsat 8 GeoTIFF images into RGB pan-sharpened JPEGs

Locate, download and process Landsat 8 GeoTIFF images into RGB pan-sharpened JPEGs

Start here

The following steps can get tedious. You're going to need to want it. Get in the mood by viewing some timelapse imagery.

Locate data for download

AWS gererously hosts Landsat imagery. This imagery can be easily searched and downloaded through Development Seed's Libra tool (You'll need to register for a free USGS account). It can be useful to see path & row graphically, so download shapefile or kml from here.

Naming

LXSPPPRRRYYYYDDDGSIVV ##L``X``S``PPP``RRR``YYYY``DDD``G``S``I``VV

  • L = Landsat
  • X = Sensor
  • S = Satellite
  • PPP = WRS path
  • RRR = WRS row
  • YYYY = Year
  • DDD = Julian day of year
  • GSI = Ground station identifier
  • VV = Archive version number

see also

Bands

read this and that

  • Band 1 - Coastal aerosol
  • Band 2 - Blue
  • Band 3 - Green
  • Band 4 - Red
  • Band 5 - Near Infrared (NIR)
  • Band 6 - SWIR
  • Band 7 - SWIR 2
  • Band 8 - Panchromatic
  • Band 9 - Cirrus
  • Band 10 - Thermal Infrared (TIRS)
  • Band 11 - Thermal Infrared (TIRS)

A processing example in Ubuntu:

Convert Landsat 8 GeoTIFF images into RGB pan-sharpened JPEGs by borrowing some knowledge from Andy Mason's script

  • First install requirements:
    • install gdal - sudo apt-get install gdal-bin
    • install image-magick - sudo apt-get install imagemagick php5-imagick
    • install dans-gdal-scripts - sudo apt-get install dans-gdal-scripts
  • Download and unzip the imagery files
  • Download that script from the above GIST, place it in the same folder you'll download imagery to, and name it process_landsat.sh
  • Then run something like: bash process_landsat.sh LC82010242013198LGN00 where LC82010242013198LGN00 is the scene (or first part of the file name)
  • That script will create a temporary folder called tmp which you don't really need after the processing is done
  • The final product will be named final-pan-rgb-corrected.jpg. I'd recommend naming that to match the Landsat convention if you'll be doing this with multiple image sets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment